Wednesday, 5 November 2014

How to check website is in IDEAL Mode




Just include jquery.js file and paste into the html file

<script>
var timeout = null;
var popup=0;
var mouseEvent=0;
$(document).on('mousemove', function(e) {
   mouseEvent=1;
     // if(popup==0){//alert(11)
    if (timeout !== null) {
        clearTimeout(timeout);
    }

    timeout = setTimeout(function() {
       if(popup==0)
          {
         location.reload()
          }
      //  $(document.body).text('Mouse idle for 3 sec');
    }, 300000);
     // }
     
});

timeout = setTimeout(function() {
if(mouseEvent==0) { location.reload()  }
},120000 );

No comments:

Post a Comment