Skip to content

Instantly share code, notes, and snippets.

@adjohu
Created May 18, 2012 09:02
Show Gist options
  • Save adjohu/2724099 to your computer and use it in GitHub Desktop.
Save adjohu/2724099 to your computer and use it in GitHub Desktop.
$(function(){
(function() {
var isMobile = function() {
return navigator.userAgent.search(/iphone|ipod|ipad|android/i) > -1;
};
var fixSliderPosition = function() {
var slider = $("#qContent");
if (!slider.length) {
setTimeout(fixSliderPosition, 200);
return;
}
slider.show();
slider.height(110);
setInterval(function() {
var top = ($(window).scrollTop() + $(window).height()) - slider.height() +40;
slider.css("top", top);
}, 10);
}
if (isMobile()) {
fixSliderPosition();
}
})();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment