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

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -