Posted By

mariraj on 07/08/11


Tagged

scroll top


Versions (?)

SCroll top and popup center


 / Published in: jQuery
 

Popup center and scroll top script

  1. $( 'html, body' ).animate( { scrollTop: 0 }, 0 );
  2. var winH = $(window).height();
  3. var winW = $(window).width();
  4. var centerDiv = $("#"+container_id);
  5. centerDiv.css('top', (winH/2-centerDiv.height()/2) + 100);
  6. centerDiv.css('left', winW/2-centerDiv.width()/2);

Report this snippet  

You need to login to post a comment.