jquery - Open pirobox lightbox on load instead of click -


i need in opening pirobox lightbox on page load instead of clicking on it.

http://www.pirolab.it/pirobox/index.php

pirobox doesn't support explicitly, can programmatically trigger "fake" click onload.

for example:

<script type="text/javascript"> $(function() {    $('#myid').click(); }); </script>  <body>     <a href="big1.jpg" rel="single" class="pirobox" title="your title" id="myid">         <img src="small1.jpg"  />     </a> </body> 

here's fixed version of original approach (though do not recommend using inline javascript this!):

<script type="text/javascript"> function open_popup() {    $('#myid').click(); } </script>  <body onload="open_popup()">     <a href="big1.jpg" rel="single" class="pirobox" title="your title" id="myid">        <img src="small1.jpg"  />     </a> </body> 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -