javascript - Run Multiple Scripts after Page Loads -


i have following javascripts:

<script type="text/javascript">         $('#homeslideshow ul.images').jslideshow({             auto: true,             delay: 15,             indicators: '#homeslideshow ul.indicators'         }); </script> 

and:

<script type="text/javascript">window.onload = function () { document.getelementbyid('features').style.visibility = 'visible'; };</script> 

i combine first script onload function of second script. both scripts run once page loaded.

this run once dom has been loaded. http://api.jquery.com/ready/

$(document).ready(function() {          $('#homeslideshow ul.images').jslideshow({             auto: true,             delay: 15,             indicators: '#homeslideshow ul.indicators'         });          document.getelementbyid('features').style.visibility = 'visible';  }); 

or short hand .ready()

$(function() {              $('#homeslideshow ul.images').jslideshow({                 auto: true,                 delay: 15,                 indicators: '#homeslideshow ul.indicators'             });              document.getelementbyid('features').style.visibility = 'visible';  }); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -