SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: popup, bah!

  1. #1
    Non-Member Frozentoast's Avatar
    Join Date
    Apr 2002
    Location
    Manchester, UK
    Posts
    4,758
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    popup, bah!

    Hey there.


    I am currently having trouble with pop-ups. I have acquired a script which allows pop-ups, but for some reason, I can't link any files to be "poped up" unless there an image. For example .gif .jpg formats will work. But as soon as I try to link the popup to a flash file (.swf) it will not work. And a small red X appears, as if the script were looking for an image but couldn't find it.

    Here is the jscript I am using.

    HTML Code:
    <SCRIPT LANGUAGE="JavaScript">
    //Popup window: FrozenToast
    function popup(name,width,height)
    		{
    			var popup = window.open("","Images","width=" + width + ",height=" + height + ",toolbar=0, status=0, menubar=0, resizable=0, scrollbars=no, directories=0, dependent=yes");
    			popup.resizeTo(width,height);
    			popup.document.open();
    			popup.document.write("<html><title>FrozenToast</title><body bgcolor='#FFFFFF' bottommargin=0 rightmargin=0 leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><table width='100%' height='100%' border=0 cellspacing=0 cellpadding=0><tr><td align='center' valign='middle'><a href='javascript:self.close();'><img src='" + name + " 'border=0 alt='Click anywhere to close.'></a></td></tr></table></body></html>");
    			popup.document.close();
    			popup.moveTo((screen.width-width)/2, (screen.height-height)/2); 
    			popup.focus()
    		}
    </script>
    And here is an example of a link to activate the popup

    HTML Code:
    <td><a href="javascript:popup('http://www.********.com/******.swf',700,420);">Link</a>
    Can anyone help?

  2. #2
    SitePoint Addict
    Join Date
    Sep 2003
    Location
    Kingston
    Posts
    246
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, gif and jpg files can be called within the <IMG > tag, swf files can't. You would have to modify the script to make the popup.document.write statement write conditional code for swf files (<EMBED > ... ?).

    Hope this helps.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •