Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open Rollover Link in Same Window?

    Novice "JavaScripter" working in TextPad. Started with "Planes" Rollover effect script (Thanks Javascriptkit.com!)

    Trying to adapt to result in thumbnail images that will display larger image on mouseover (got that working); AND open another page (internal link) in same window with onclick. I got it working with the new page in a new window; but can't get it in same window. I know this is most basic; but I'm spinning my wheels longer than I can afford. Thanks for any help.

    Source code follows: (isolated example, followed by entire page)

    SAMPLE:

    Code:
    <TD>
      <a href="Shed.htm" onMouseover="changeimage(myimages[0],this.href)" onClick="ASG-Shed.htm">
        <IMG HEIGHT="65" SRC="Shed_t.gif" ALT="Click to view style details" BORDER="0"><br><FONT FACE="ARIAL" COLOR="000000" SIZE="-2"><B>Shed Awnings</B></FONT></A>
    </TD>

    FULL PAGE:

    Code:
    <html>
    <head>
    <title>Project Gallery Screen</title>
    <script>
    
    /*Rollover effect on different image script-
    By JavaScript Kit (http://javascriptkit.com)
    Over 200+ free scripts here!
    */
    
    function changeimage(towhat,url){
    if (document.images){
    document.images.targetimage.src=towhat.src
    gotolink=url
    }
    }
    function warp(){
    window.location=gotolink
    }
    
    </script>
    <script language="JavaScript1.1">
    var myimages=new Array()
    var gotolink="#"
    
    function preloadimages(){
    for (i=0;i<preloadimages.arguments.length;i++){
    myimages[i]=new Image()
    myimages[i].src=preloadimages.arguments[i]
    }
    }
    
    
    preloadimages("Shed.gif","Concave.gif","Convex.gif","TransverseConvex.gif","Dome.gif","ExtendedDome.gif","Sign.gif","Custom1g.gif")
    </script>
    
    </head>
    <body>
    
    <TABLE BORDER="0" CELLSPACING=2" CELLPADDING="2">
    <TR>
      <TD COLSPAN="6" ALIGN="CENTER"><FONT FACE="ARIAL" SIZE="+2"><B><I>Awning Definition & Project Styles</I></B></FONT></TD>
      <TD Align="Center"><form>
    <input type="button" value="Back" onclick="history.back()">
    </form></TD>
    </TR>
    <TR>
      <TD COLSPAN="4"><FONT FACE="Arial,Helvetica" SIZE=-2" ALIGN="Justified">Awnings are defined as fabric structures that
      are entirely supported by a wall and have a drop-to-projection ratio greater than 1/3
      (0.33). The drop-to-projection ratio is determined by dividing the drop by the projection.
      Awnings with drop-to-projection ratios less than 0.33 are not recommended and generally
      cost more due to the high strength connections they require. Also, when the ratio is less
      than 0.33, fabric selection is limited to non-porous (impervious) fabrics. The basic awning
      styles are seen below; however, customized shapes can also be accommodated.<br>
      </FONT>
      <TD COLSPAN="3" ALIGN="center"><IMG HEIGHT="85" SRC="AwningDefinition_sml.gif"></TD>
    </TR>
    
    <TR>
    <TD>
      	<a href="Shed.htm" onMouseover="changeimage(myimages[0],this.href)" onClick="ASG-Shed.htm">
      	  <IMG HEIGHT="65" SRC="Shed_t.gif" ALT="Click to view style details" BORDER="0"><br><FONT FACE="ARIAL" COLOR="000000" SIZE="-2"><B>Shed Awnings</B></FONT></A>
      </TD>
    <TD>
      	<a href="Concave.htm" onMouseover="changeimage(myimages[1],this.href)">
      	  <IMG HEIGHT="65" SRC="Concave_t.gif" ALT="Click to view style details" BORDER="0"><br><FONT FACE="ARIAL" COLOR="000000" SIZE="-2"><B>Concave Awnings</B></FONT></A>
      </TD>
      <TD>
      	<a href="Convex.htm" onMouseover="changeimage(myimages[2],this.href)">
      	  <IMG HEIGHT="65" SRC="Convex_t.gif" ALT="Click to view style details" BORDER="0"><br><FONT FACE="ARIAL" COLOR="000000" SIZE="-2"><B>Convex Awnings</B></FONT></A>
      </TD>
      <TD>
        <a href="TransverseConvex.htm" onMouseover="changeimage(myimages[3],this.href)">
      	  <IMG HEIGHT="65" SRC="TransverseConvex_t.gif" ALT="Click to view style details" BORDER="0"><br><FONT FACE="ARIAL" COLOR="000000" SIZE="-2"><B>Transverse Convex</B></FONT></A>
      </TD>
      <TD ROWSPAN="4" COLSPAN="3" ALIGN="center">
      	<a href="javascript:warp()">
      	  <IMG WIDTH="250" SRC="Shed.gif" name="targetimage" border=0></A>
      </TD>
    </TR>
    
    <TR>
      <TD COLSPAN="4" ALIGN="CENTER"><FONT FACE="ARIAL" SIZE="-1"><B>Mouseover Thumbnail to View Enlarged Image<br>
      CLICK on Thumbnail to View Style Details</B></FONT>
      </TD>
    </TR>
    
    <TR>
      <TD>
      	<a href="Dome.htm" onMouseover="changeimage(myimages[4],this.href)">
      		<IMG HEIGHT="65" SRC="Dome.gif" ALT="Click to view style details" BORDER="0"><br><FONT FACE="ARIAL" COLOR="000000" SIZE="-2"><B>Dome Awnings</B></FONT></A>
      </TD>
      <TD>
    	<a href="ExtendedDome.htm" onMouseover="changeimage(myimages[5],this.href)">
    		<IMG HEIGHT="65" SRC="ExtendedDome.gif" ALT="Click to view style details" BORDER="0"><br><FONT FACE="ARIAL" COLOR="000000" SIZE="-2"><B>Extended Dome Awnings</B></FONT></A>
      </TD>
      <TD>
     	<a href="Sign.htm" onMouseover="changeimage(myimages[6],this.href)">
     	 	<IMG HEIGHT="65" SRC="Sign.gif" ALT="Click to view style details" BORDER="0"><br><FONT FACE="ARIAL" COLOR="000000" SIZE="-2"><B>Sign Awnings</B></FONT></A>
      </TD>
      <TD>
      	<a href="Custom1g.htm" onMouseover="changeimage(myimages[7],this.href)">
      		<IMG HEIGHT="65" SRC="Custom1g.gif" ALT="Click to view style details" BORDER="0"><br><FONT FACE="ARIAL" COLOR="000000" SIZE="-2"><B>Custom Awnings</B></FONT></A>
      </TD>
    </TR>
    </TABLE>
    </body>
    </html>
    Last edited by liorean; 06-03-2004 at 10:51 AM. Reason: [code]

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    I don't understand what is your intention... You have a function called onmouseover. basically that function suppose to load the full picture AND to open the same time another page (let's forget for a moment that another function called warp() exists but it is not called by any handler of other function)?

    If so, what is onclick for? What is href location for?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you, Kor, for responding. My ignorance is showing. I have no idea what the "warp()" reference is. It was in the original script pulled from javascriptkit.com (see http://javascriptkit.com/script/scri...ifferent.shtml)

    My goal is to a) have a mouseover of a thumbnail image display the full size image in a designated area of the same screen (that much is accomplished) AND b) have an onclick of the same thumbnail link to another, totally different page (new information/specifications related to the image), to replace the original screen content (but to include a "back" button). I did not include code for that page, as it is not of any consequence to the issue.

    Is that more clear? I feel certain that the answer is as simple as a properly coded and positioned "target" instruction; but can't find the right combination.

    Thanks for your patience.

    tommyd

  • #4
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Found It!!!

    Thanks to Kor, and any others who looked at this question. As might be expected, I had mis-named the target .htm file in the <a href code; and was concentrating on forcing an "onClick" instruction when it wasn't even necessary.

    At least I've learned from the experience; but boy, do I feel stupid.

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    That means you solved your problem?

    Of course, there is no use to have both a href url and a onclick function if both have to open a new page...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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