/ Published in: jQuery
Popup center and scroll top script
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$( 'html, body' ).animate( { scrollTop: 0 }, 0 ); var winH = $(window).height(); var winW = $(window).width(); var centerDiv = $("#"+container_id); centerDiv.css('top', (winH/2-centerDiv.height()/2) + 100); centerDiv.css('left', winW/2-centerDiv.width()/2);