We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36926
    • 701 Posts
    Hi,

    I need to some how reload the page when a user re sizes their browser. I’m using jquery.

    I’m able to reload the page on click and i can peform a function on resize, but for some reason the reload bit doesn’t work when in the function that firs on resize.

    What i have so far:

    This works on click
    $('#target').click(function() {
    
    
    window.location.reload(true);
    });


    and this fires the resizeWindow function ok but the window.location.reload(true); is ignored
     $(window).bind("resize", resizeWindow);
     
     function resizeWindow( e ) {
    	  alert('Handler for .click() called.');
    
    
    
    			};


    Anyone got any ideas, search loads and can’t seem to find anything. It can be done can’t it?

    Thanks

    Ben
      • 24393
      • 83 Posts
      something like this should work with mootools/jquery:

      window.addEvent('resize', function() {
           window.location.reload();
      });


        stevesunderland.com
        GRAPHICS | INTERACTIVE | MARKETING
        xhtml + ajax + seo websites powered by modx
        • 36926
        • 701 Posts
        Quote from: rajfantastic at Feb 24, 2010, 02:28 AM

        something like this should work with mootools/jquery:

        window.addEvent('resize', function() {
             window.location.reload();
        });




        Hey thanks for the reply, for some reason that doesn’t work. I just cant get the reload to work within a resize function. It’s fine if it’s applied to a click or something.