Results 1 to 4 of 4

Thread: I need popup window when i click on rollover link

  1. #1
    Join Date
    Feb 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I need popup window when i click on rollover link

    i need someone to help me with the following html with javascript... this contains the rollover-image link already, but i want a popup window of 700px width and 690px height to "popup" when you click on the rollover...

    at the moment the rollover image just opens a new "normal" window like a normal link



    the javascript for the popup might look like this:


    <script language="javascript" type="text/javascript">//<!--
    function popup()
    { window.open ("01.html","popup","width=700,height=690,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=1,toolbar=0") }
    -->
    </script>

    ...but it just opens the new popup automatic and not when you click on the rollover link




    this is the html i need edited....


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>tiltle</title>
    <!-- Rollover Image Script - Place within <head> tag -->
    <script language="JavaScript" type="text/javascript">
    <!-- Hide from older browsers
    function SwitchImg()
    { //start
    var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
    for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
    store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
    if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
    (store.indexOf('document.all[')==0 && document.all==null))
    store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
    obj = eval(store);
    if (obj != null) {
    switcher[keep++] = obj;
    switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
    obj.src = SwitchImg.arguments[rem+2];
    } }
    document.Data = switcher;
    } //end

    function RestoreImg()
    { //start
    if (document.Data != null)
    for (var rem=0; rem<(document.Data.length-1); rem+=2)
    document.Data[rem].src=document.Data[rem+1];
    } //end

    // end hiding contents -->
    </script>

    </head>
    <body>
    <script language="javascript" type="text/javascript">
    </script>
    <table style="text-align: left; width: 1008px; height: 564px;"
    border="0" cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <td style="vertical-align: top; text-align: center;"><a href="01.html" onMouseOut="RestoreImg()" onMouseOver="SwitchImg('document.e1','document.e1','e1ani.gif')"><img src="e1.jpg" name="e1" width="200" height="110" alt="" border="0"></a></td>
    </tr>
    </tbody>
    </table>
    <script language="javascript" type="text/javascript">//<!--
    function popup()
    { window.open ("01.html","popup","width=700,height=690,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=1,toolbar=0") }
    -->
    </script>
    <table>
    </table>
    <div style="text-align: center;"><br>
    </div>
    </body>
    </html>

    if anyone could help me, that would be great......greetz from germany, VIL

    you can check the problem out if you want
    here
    Last edited by vil; 02-27-2005 at 11:20 AM.

  2. #2
    Join Date
    Mar 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    Hi There,
    I am absolutely certain I have found the solution to your problem. But first, would you please post the link that you want the pop-up to appear when clicked on please? Thanks

  3. #3
    Join Date
    Mar 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You can't have quite that many parameters on openWindow. (Had that problem myself a while back.) Try concatenating into a variable and using the variable as a parameter. It should work just fine. Let me know if you have any problems and I'll dig up an example.

    Hasame

  4. #4
    Join Date
    Feb 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks guys fixed the problem!!!!

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
  •