Commit b9938b96 by halweg

Merge branch 'developer' of http://47.99.244.21:9999/root/joshine into developer

parents 00e9b58a 65a8b553
...@@ -24,19 +24,12 @@ ...@@ -24,19 +24,12 @@
var isMobile = window.matchMedia("(pointer:coarse)").matches; var isMobile = window.matchMedia("(pointer:coarse)").matches;
if (isMobile) { if (isMobile) {
$(window).scroll(function () { $(window).scroll(function () {
var checkoutBtn = $('.cart-container .checkout-methods-items li:first-child'); var positionUl = $('.cart-container .checkout-methods-items li:first-child')
var scrollTop = $(document).scrollTop(); if (window.outerHeight + $(document).scrollTop() < $(positionUl).parent().offset().top + 50) {
var wh = $(document.body).height(); $(positionUl).removeClass("button-static");
var offsetTop = $(checkoutBtn).offset().top;
if (wh - offsetTop <= scrollTop) {
if(!$(checkoutBtn).hasClass('button-static')){
$(checkoutBtn).addClass('button-static');
}
} else { } else {
if($(checkoutBtn).hasClass('button-static')) $(positionUl).addClass("button-static");
{
$(checkoutBtn).removeClass('button-static');
}
} }
}); });
} }
......
...@@ -496,6 +496,7 @@ ...@@ -496,6 +496,7 @@
padding: 5px 20px; padding: 5px 20px;
} }
.button-fix { .button-fix {
width:100%!important;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
...@@ -818,15 +819,15 @@ script; ...@@ -818,15 +819,15 @@ script;
else { else {
$(window).scroll(function () { $(window).scroll(function () {
if(!$('#checkout-step-shipping').is(":visible")) { if(!$('#checkout-step-shipping').is(":visible")) {
var scrollTop = $(document).scrollTop() - 120; $(window).scroll(function () {
var wh = $(document.body).height(); var positionUl = $('#checkout_place_order')
var offsetTop = $('#checkout_place_order').offset().top; if (window.outerHeight + $(document).scrollTop() < $(positionUl).offset().top + 50) {
if (wh - offsetTop <= scrollTop) { $('#place-order').addClass("button-fix");
//
$('#checkout_place_order').removeClass('button-fix');
} else { } else {
$('#checkout_place_order').addClass('button-fix'); $('#place-order').removeClass("button-fix");
} }
});
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment