internet explorer 8 - IE8 Screen Resize Called on jQuery Toggle -


i'm having issues ie8 (imagine that...) when i'm calling function on screen resize. function calling set of responsive tweaks designed make site more usable on mobile devices. call function on page load , after screen has been resized. issue i'm experiencing occurs when use jquery toggle on scree, such search box. according ie8, each time toggle something, triggers screen resize function , then hides stuff toggled.

i created gist sample code because pastebin , ie8 don't seem work together. https://gist.github.com/johns996/5501932

simple solution problem, check if resize did resize window:

//run tweaks on page resize var x,y; var w=$(window).resize(function() {     var newx=w.width();      var newy=w.height();     if(x!=newx || y!=newy){         // run code...     }     x=newx; y=newy; }); 

just tested in ie8 , works.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -