show/hide issue. want to initial show in jquery -
i new in jquery. want display or hide matched element. use slidetoogle() function. code is
$(document).ready(function () { $(".show_hide").show(); $(".slidingdiv").hide(); $('.show_hide').click(function () { $(".slidingdiv").slidetoggle(); }); });
here .show_hide class link , .slidingdiv class div content. want if load page .slidingdiv content initial show
set slidingdiv intially 'display:block' , when page loads shown
.slidingdiv { display:block; } $(document).ready(function () { $('.show_hide').click(function () { $(".slidingdiv").slidetoggle(); }); });
or change jquery code to
$(document).ready(function () { $(".show_hide, .slidingdiv").show(); $('.show_hide').click(function () { $(".slidingdiv").slidetoggle(); }); });
Comments
Post a Comment