Wednesday, 15 April 2015

jquery - Hiding the read more div/button/text -



jquery - Hiding the read more div/button/text -

i need help hiding div when user clicks on , sliding downwards content of div hidden.the next code sliding downwards hidden div.

$(document).ready(function (){ $('.hide').hide(); $('.main:has(".hide")').find('div.toggle').click(function() { var el = $(this).next('.hide'), check = (el.is(':visible')) ? el.slideup() : ($('.hide').slideup()) (el.slidedown()); }); });

the above illustration here , this link has total markup , experiment tried hide read more div hides every div.also if help me explain above if else shorthand statement.

thanks query solved :)

i think need larn how utilize this. this keyword refers element click on. so, can $(this).hide() or remove(), or toggle(), or ever want.

http://jsbin.com/awirap/5/edit

jquery this

edit: show read more when click on this:

$('.toggle').show();

you show of them, , after bit of code $(this).hide(); hide 1 you've clicked on.

jquery shorthand

No comments:

Post a Comment