/ Published in: JavaScript
wild scope on genuineBottom...
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var genuineBottom = parseInt($("#alertwindow-'.$view->getParam("uniqid").'").css("bottom").slice(0,-2),10); if (genuineBottom == undefined || genuineBottom == NaN) { genuineBottom = 0; } $(window).scroll(function() { offset = $($("#alertwindow-'.$view->getParam("uniqid").'")).offset(); var newTop = $(window).height() - $("#alertwindow-'.$view->getParam("uniqid").'").height() + $(window).scrollTop() - genuineBottom; $("#alertwindow-'.$view->getParam("uniqid").'").css("top", newTop + "px"); });