3
Contributors
8
Replies
40
Views
4 Years
Discussion Span
Last Post by Cravver
0

Please test the button that makes it go up. It goes up but doesnt come down, how do i fix this? This is the code for it:

    var buttonEls =  $("#arrow-tb-op-up"); //button inside element

    jQuery(buttonEls).click(
       function(){
        $(this).parent().animate({marginBottom: "0px"}, 300 );
        $(this).html('»');
    }, function(){
        $(this).parent().animate({marginBottom: "200px"}, 300 );
        $(this).html('«');
});
});
0

You could set a variable outside the function to record what state it is in. onclick change the state.

I was going to suggest using .toggle but I think that method is deprecated since 1.9

0

well the fact being that jQuery removed toggle since 1.9 annoyed me so i went with 1.8.

and changed .click() to .toggle()

Edited by Cravver

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.