Posted By

tnntwister on 07/20/12


Tagged

jquery


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

tnntwister


simulate position:fixed with bottom (jquery)


 / Published in: JavaScript
 

wild scope on genuineBottom...

  1. var genuineBottom = parseInt($("#alertwindow-'.$view->getParam("uniqid").'").css("bottom").slice(0,-2),10);
  2. if (genuineBottom == undefined || genuineBottom == NaN)
  3. {
  4. genuineBottom = 0;
  5. }
  6.  
  7. $(window).scroll(function() {
  8. offset = $($("#alertwindow-'.$view->getParam("uniqid").'")).offset();
  9. var newTop = $(window).height() - $("#alertwindow-'.$view->getParam("uniqid").'").height() + $(window).scrollTop() - genuineBottom;
  10. $("#alertwindow-'.$view->getParam("uniqid").'").css("top", newTop + "px");
  11. });

Report this snippet  

You need to login to post a comment.