Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Using JavaScript to keep the "fixed" page width in sync with browser size and orientation changes.
- Try rotating your phone or resizing the browser window here; http://www.gotlandindies.org/ */
- jQuery(document).ready(function() {
- var waiting = false;
- function wait(){
- if(waiting){
- clearTimeout(waiting);
- waiting = false;
- }
- waiting = setTimeout(doScale, 100); //a delay to avoid duplicate event calls.
- }
- function doScale(){
- var w = jQuery(window).width();
- //if(w < 1024){ w = 1024; }
- jQuery('.container').animate({
- width:w+'px'
- }, 800, function(){
- jQuery('.container').css('overflow', 'hidden');
- }
- );
- }
- jQuery(window).bind('orientationchange', wait);
- jQuery(window).bind('resize', wait);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement