Good afternoon, I can not figure out how to make an autoclick on an object using javascript.

In this case, by the picture, I took it in a div and assigned an id . A modal window is attached to the image by clicking on it, and it should be opened.

<div id="ff1"><label for="modal-1"><img src="/uploads/main/bonus_ssi_ok.png"></label>/div> 

This is not the beauty of Google and tried to set up, does not work. (inserted at the end of the page)

 <script type="text/javascript"> $(document).ready(function(){ setTimeout(function(){ $('#ff1').click(); },5000); }); </script> <script src="path/to/your/jquery.remodal.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
  • A modal window is attached to the image by clicking on it, and it should be opened. - to the picture or diva? how tied? - splash58
  • I took the picture from two sides <label>, and already this <label> wrapped in <div> - Zlogin
  • Yes, it can be seen, but the click handler is not at all obvious. I asked about this - splash58
  • solved a problem! I set the id exactly to the image, everything works. Thanks to the author, who answered in some of the local questions, from there he took the script. The question is not relevant - Zlogin

0