SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot w1nk5's Avatar
    Join Date
    Aug 2009
    Location
    Ontario, Canada
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery click() not firing on second click.

    On this website: http://174.121.35.252/~californ/projects/

    Under the phone number in the header there is a little blue arrow that slides down the slider, which works perfectly. However, clicking the arrow again should slide the slider backup but nothing is happening.

    Here is the jQuery handling this:
    Code:
    $('#open-slider').click(function() {		
    		
    	if($("#slider").is(":hidden")) {
    		$(this).animate({"background-position": "17px 0"});
    		$("#slider").animate({"margin-top": "-490px"});
    		$('header').animate({"margin-bottom": "45px"});	
    		$("#slider").hide();
    	} else {
    		$(this).animate({"background-position": "0 0"});
    		$("#slider").animate({"margin-top": "0"});
    		$('header').animate({"margin-bottom": "490px"});
    		$("#slider").show();
    	}
    
    });
    Any help would be greatly appreciated.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    If the slider is hidden you hide it, and if it's not hidden you show it.

    Something seems not right there.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Zealot w1nk5's Avatar
    Join Date
    Aug 2009
    Location
    Ontario, Canada
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hahaha wow. You can tell I was looking at for toooo long.

    Thanks


Bookmarks

Posting Permissions

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