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 3 of 3
  1. #1
    Kal
    Kal is offline
    Regular Coder
    Join Date
    Dec 2005
    Posts
    309
    Thanks
    0
    Thanked 0 Times in 0 Posts

    On hover hyperlink change image

    Hi,

    can anyone help with a script which will change an image in a different frame when you hover over a link in a navigation frame.

    i have mamanged to get the images to change within the same frame, but having trouble changing it within another frame. the code is below.

    Code:
    <FRAMESET COLS="5%,*,5%"> 
    
    <FRAME NAME="left_white" SCROLLING="no" NORESIZE>
    
    <FRAMESET ROWS="65,*,25"> 
    
    <FRAME NAME="header" SCROLLING="no" NORESIZE> 
    
    <FRAMESET COLS="153,756,153"> 
    <FRAME NAME="left" SCROLLING="no" SRC="left.html" NORESIZE TARGET="main"> 
    <FRAME NAME="main" SRC="main.html"> 
    <FRAME NAME="right" SCROLLING="no" NORESIZE> 
    
    </FRAMESET> 
    
    <FRAME NAME="bottom" SCROLLING="no" NORESIZE> 
    
    <!--<NOFRAMES> 
    
    <BODY> 
    <P>This page uses frames, but your browser doesn't support them.</P> 
    </BODY> 
    
    </NOFRAMES>--> 
    
    </FRAMESET> 
    
    <FRAME NAME="right_white" SCROLLING="no" NORESIZE>
    
    </FRAMESET>
    Code:
    <img name="main_image" src="images/pink.jpg" 
    border=0 alt="Rollover Image" width="100" height="100">
    
    <p>
    
    <a href="#" 
    onmouseover='main_image.src = "images/red.jpg";rollover1.src="images/ltred.jpg"' 
    onmouseout='main_image.src="images/pink.jpg";rollover1.src="images/red.jpg"'>
    Hyperlink 1</a>
    &nbsp;
    
    <a href="#" 
    onmouseover='main_image.src = "images/green.jpg";rollover2.src="images/ltgreen.jpg"' 
    onmouseout='main_image.src="images/pink.jpg";rollover2.src="images/green.jpg"'>
    Hyperlink 2</a>
    &nbsp;
    
    <a href="#" 
    onmouseover='main_image.src = "images/blue.jpg";rollover3.src="images/ltblue.jpg"' 
    onmouseout='main_image.src="images/pink.jpg";rollover3.src="images/blue.jpg"'>
    Hyperlink 3</a>
    &nbsp;
    thanks in advance.
    Last edited by Kal; 10-19-2006 at 02:11 PM.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    parent.framename.getElementById("asdf").src = 'foo.bar';
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Kal
    Kal is offline
    Regular Coder
    Join Date
    Dec 2005
    Posts
    309
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cheers mate, just sorted it.


  •  

    Posting Permissions

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