Skip to content

Instantly share code, notes, and snippets.

@coolicer
Created April 20, 2012 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coolicer/2426306 to your computer and use it in GitHub Desktop.
Save coolicer/2426306 to your computer and use it in GitHub Desktop.
Javascript : compatPositionFixed
//Fixed IE6 Position Fixed
(function(){
if(/MSIE 6/i.test(navigation.userAgent)) {
function compatPositionFixed(node) {
var top = 150;
node.style.position = "absolute";
node.style.top = top + document.documentElement.scrollTop + 'px';
window.attachEvent('onscroll',function(){
node.style.top = top + document.documentElement.scrollTop + 'px';
});
}
compatPositionFixed() //require obj id
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment