sex
This commit is contained in:
commit
d844e77940
833 changed files with 11089 additions and 0 deletions
21
9392b3ca-7a7f-460d-9686-2c69d43b6fe5/js/sticky-promo.js
Normal file
21
9392b3ca-7a7f-460d-9686-2c69d43b6fe5/js/sticky-promo.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
var stickyPromoAnchor = $('.sticky-promo-anchor').offset();
|
||||
|
||||
$(window).scroll(function() {
|
||||
xPos = $(this).scrollTop();
|
||||
|
||||
stickyPromo(xPos, stickyPromoAnchor.top);
|
||||
});
|
||||
|
||||
function stickyPromo(xPos, anchorPos)
|
||||
{
|
||||
var offsetBy = 90;
|
||||
var offsetPos = anchorPos - offsetBy;
|
||||
|
||||
if (xPos > offsetPos) {
|
||||
$('.sticky-promo').css('position', 'fixed');
|
||||
$('.sticky-promo').css('top', offsetBy);
|
||||
} else {
|
||||
$('.sticky-promo').css('position', 'relative');
|
||||
$('.sticky-promo').css('top', 0);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue