I have this js code to click certain part of the page on page load. It works alright but I want it to delay X number of seconds before event occurs. onload="$('ul.galleria li:last img').trigger('click'); Code (markup): Please advice. Thanks.
So, put it in a function then in the onload set a timer for that function for X * 1000 ms. This page has a bunch of good examples: http://www.howtocreate.co.uk/tutorials/javascript/timers
<!-- 5000 means 5 seconds --> <body onload="setTimeout(function(){$('ul.galleria li:last img').trigger('click');},5000);"> HTML: