Last active
December 16, 2015 13:59
-
-
Save naotone/5445179 to your computer and use it in GitHub Desktop.
Hide position: fixed; elements after pinch zoom.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Copyright 2013 NAOTONE | |
//Please use under MIT license. | |
jQuery(window).resize(function() { | |
iOSClearFixed(); | |
}); | |
jQuery('html').on("touchend", touchHandler); | |
touchHandler = function(event) { | |
return iOSClearFixed; | |
}; | |
iOSClearFixed = function() { | |
var zoom; | |
zoom = document.documentElement.clientWidth - window.innerWidth; | |
if (zoom >= 80) { | |
return jQuery(".fixed").css("z-index", -1); | |
} else{ | |
return jQuery(".fixed").css("z-index", 10); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment