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
    Regular Coder
    Join Date
    Dec 2005
    Location
    UK
    Posts
    207
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Jquery Gallery - mouseover problem

    I have a jquery gallery which I have adapted to look the way I want it to.

    I then tried to add a bit of functionality but unfortunately it doesn't quite work right.

    The page is located at http://www.tombrennand.net/gallery

    I tried to make it so that the gallery navigation fades in/out on mouseover/out.

    This works fine until you actually hover over the buttons. Then it goes wrong as you'll see.

    The code I added is as follows...

    Code:
    $(".strip_wrapper").css("opacity","0.0")
    		$(".nav-next").css("opacity","0.0")
    		$(".nav-prev").css("opacity","0.0")
    		$("#pointer").css("opacity","0.0")
    		
    		$(".panel").mouseover(function(){
    			$(".strip_wrapper").fadeTo("slow",1.0)
    			$(".nav-next").fadeTo("slow",1.0)
    			$(".nav-prev").fadeTo("slow",1.0)
    			$("#pointer").fadeTo("slow",1.0)
    			
      		})
    		
    		$(".panel").mouseout(function(){
      			$(".strip_wrapper").fadeTo("slow",0.0)
    			$(".nav-next").fadeTo("slow",0.0)
    			$(".nav-prev").fadeTo("slow",0.0)
    			$("#pointer").fadeTo("slow",0.0)
      		})
    Any ideas would be much appreciated.

    Thanks

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    You should take a look at the documentation for mouseover. There's an example on that page that illustrates what you're seeing.

    IS there a reason you're not just using the hover() function?
    Are you a Help Vampire?

  • #3
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    try adding a stop in front of all your fades like so:

    Code:
    $(".strip_wrapper").stop().fadeTo("slow",1.0)
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis


  •  

    Posting Permissions

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