TufanCPN
TufanCPN

Reputation: 23

Start automaticly Function JavaScript

 <div  class="scroll-btn hidden-sm hidden-xs wow bounceInDown" data-wow-delay="1.4s">
     <a id="introjs" href="javascript:void(0)" onclick="introJs().start();">
         <span class="mouse">
         <span class="weel">
         <span></span>
         </span>
         </span>
     </a>
 </div>

Can i start to onclick funtion automatic on page load or on page ready. Not on click #introjs element.

Upvotes: 0

Views: 63

Answers (1)

dbl4k
dbl4k

Reputation: 71

Either use JQuery's $(document).ready()

or without JQuery, something like this would work in about 98% of browsers:

document.addEventListener("DOMContentLoaded", function(event) { 
  //do work
});

There's a great answer here with a bit more detail on the subject https://stackoverflow.com/a/800010/8055700

Upvotes: 1

Related Questions