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
    Regular Coder
    Join Date
    Oct 2010
    Posts
    272
    Thanks
    8
    Thanked 1 Time in 1 Post

    Help With Mouseover

    I set up an image mouseover for the next button but its not working. I have two images set up but the second one wont appear when mousing over image.
    You can see it at www.college-ebook.com
    Last edited by andynov123; 07-04-2011 at 04:07 AM.

  • #2
    New to the CF scene
    Join Date
    Jul 2011
    Location
    Missouri
    Posts
    9
    Thanks
    3
    Thanked 1 Time in 1 Post
    there is a sytax error on your onMouseOut... you have onMouseOut"document.rollover.src=image1.src", there should be a = in there so it would read onMouseOut="document.rollover.src=image1.src"

    also you have the onMouseOver and onMouseOut applied to the div tag. Have you tried applying them to the image itself?

  • #3
    Regular Coder
    Join Date
    Oct 2010
    Posts
    272
    Thanks
    8
    Thanked 1 Time in 1 Post
    that syntax has now been fixed but it still doesn't work. Any thoughts?
    www.college-ebook.com

  • #4
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    Please start debugging your code

    There are exceptions everytime you hover your mouse and leave the NEXT button with your mouse

    "image1 is not defined" on mouseover
    "image2 is not defined" on mouseout

  • #5
    New to the CF scene
    Join Date
    Jul 2011
    Location
    Missouri
    Posts
    9
    Thanks
    3
    Thanked 1 Time in 1 Post
    ok, try something like this
    Code:
    <script type="text/javascript">
    function rollover(x,y) {
    	document.getElementById(x).src=y;
    }
    </script>
    then set the image up something like this
    Code:
    <img src="next.jpg" id="next" onmouseover="rollover(this.id,'next1.jpg')" onmouseout="rollover(this.id,'next.jpg')" />
    Last edited by ollie_mo; 07-03-2011 at 09:24 PM.

  • Users who have thanked ollie_mo for this post:

    andynov123 (07-04-2011)


  •  

    Posting Permissions

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