Reputation: 81
I used jquery show/hide in many place in my web. every where its work well but in this case its not hide again in 2nd click.
here is the example: http://jsfiddle.net/er9e72ww/
show/hide code
$('#uploadMedia').livequery("click",function(){
$('#show_img_upload_div').slideToggle('slow');
$("#comment").focus();
$('.upfrm').show();
$('#submit').hide();
});
Upvotes: 0
Views: 69
Reputation: 622
Just use .slideToggle('slow');
instead of show()
and hide()
like:
$('#uploadMedia').livequery("click", function () {
$('#show_img_upload_div').slideToggle('slow');
$("#comment").focus();
$('.upfrm').slideToggle('slow');
$('#submit').slideToggle('slow');
});
Upvotes: 0
Reputation: 11859
the problem here is you are hiding/showing
submit/upfrm
but not showing/hide
it again.use toggle for this:
$('.upfrm').toggle();
$('#submit').toggle();
Upvotes: 0
Reputation: 9637
use toggle() in jquery to hide and show repeatedly
$('#uploadMedia').livequery("click",function(){
$('#show_img_upload_div').slideToggle('slow');
$("#comment").focus();
$('.upfrm').toggle();
$('#submit').toggle();
});
Upvotes: 2