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 7 of 7
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    double-duty mouseover

    I am trying to get two actions out of one mouseover and have run out of things to try. When the user puts their cursor over a paticular button I want the button to change color AND allow some text to scroll. I can only get one or the other to work.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,032
    Thanks
    0
    Thanked 248 Times in 245 Posts
    Code?

  • #3
    New Coder
    Join Date
    Mar 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Code!

    Wow, I was kinda hoping it would all be stupidly simple. The button up section is where I was testing possibilities. The one below puts two buttons next to each other (one blinks, one scrolls, but not as one button).

    Is this clear as mud?

    Code:
    <!-- Text Frame  -->
    <div style="position:absolute; top:0px; left:240px">
    	<br><br><br><br>
    	<iframe id="ifr" name="ifr" src="dream_of_armageddon.html" frameBorder="0" width="450px" height="460" scrolling="no">
    	</iframe> 
    	</div>
    
    <!-- Table -->
    <div style="position:absolute; top:0px; left:0px; width:800px; height:600px">
    	<img src="wellsimages/readerontableHoles.gif" width="800" height="600" border="0">
    	</div>
    			
    <!-- Button -up -->
    <div style="position:absolute; top:86px; left:714px">
    	<a id="up" href="#" onmouseover="scrollup(); return false" onMouseOut="clearInterval(TO)"><img src="../butoff22.gif" name="up" width="33" height="33" alt="" border="0"></a>
    	<a href=" " onMouseOut="RestoreImg()" onMouseOver="SwitchImg('document.top','document.top','../buton22.gif')"><img src="../butoff22.gif" name="top" width="33" height="33" alt="" border="0"></a>
    	</div>
    				
    <!-- Button -down -->
    <div style="position:absolute; top:163px; left:714px">
    	<a id="down" href="#" onmouseover="scrolldown(); return false" onmouseout="clearInterval(TO)"><img src="../butoff22.gif" name="down" width="33" height="33" alt="" border="0"></a>
    	</div>

  • #4
    New Coder
    Join Date
    May 2005
    Location
    Alabama
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I believe that instead of using two 'onmouseover' events you only use one, example:

    <a href="#" onmouseover="yourFunctionHere(); return false; yourOtherfunctionhere()"><img></a>

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,032
    Thanks
    0
    Thanked 248 Times in 245 Posts
    The return false in the middle will cause the function call after it not to be executed. It should be at the end.

    onmouseover="yourFunctionHere();yourOtherfunctionhere();return false;"

  • #6
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    And why would you want the return to be false? I may be mistaken but doesnt this cancel the bubble effect of anything else that you are going to be calling later? Or does only cancel any more functions you have hooked to OnMouseOver?

  • #7
    New Coder
    Join Date
    Mar 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    nowhere to turn

    Hey guys, thanks for the suggestions. To answer one question, the "return false" stops the text from scrolling. I haven't got back to you all before now because I have been trying everything I can think of to get the button to light up and have the text scroll. Nothing works.


  •  

    Posting Permissions

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