This commit is contained in:
devil_gong 2018-08-23 13:45:39 +08:00
parent 3bc28d324a
commit 62ec6d2689
3 changed files with 33 additions and 128 deletions

View File

@ -12,7 +12,7 @@
<!-- goods category -->
<include file="Public/GoodsCategory" />
<div class="">
<div class="detail">
<!-- 轮播 -->
<div class="scoll">
@ -262,7 +262,7 @@
</div>
<div class="introduceMain">
<div class="am-tabs" data-am-tabs>
<ul class="am-avg-sm-3 am-tabs-nav am-nav am-nav-tabs" data-am-sticky>
<ul class="am-avg-sm-3 am-tabs-nav am-nav am-nav-tabs" data-am-sticky="{animation: 'slide-top'}">
<li class="am-active">
<a href="javascript:;">

View File

@ -313,12 +313,11 @@ li.am-comment{ width:100%}
@media only screen and (min-width:640px)
{
.am-container { padding: 10px; }
.listMain{padding-top: 10px;}
/*导航固定*/
ul.am-tabs-nav.am-nav.am-nav-tabs {margin-right:10px ;margin-left: 10px;width: auto;}
.scoll{float: left;width: calc(45% - 10px);max-width:360px;padding-right:20px; margin-left: 10px;}
.scoll{float: left;width: calc(45% - 10px);max-width:360px;padding-right:20px; }
.clearfixRight{float:left;width:55%;min-height: 270px;}
.iteminfo_parameter.freight{display: block;margin-top: 10px;margin-bottom:10px ;}
.iteminfo_parameter.freight dt{margin-left:-70px ;float: left;margin-right:10px ;padding-top:5px ;padding-bottom:20px ;}
@ -426,7 +425,7 @@ div.zoomMask { position:absolute; background:url(../images/mask.png)repeat scrol
.shopPromotion.gold{position:absolute;top:0px;padding-left:10px;background: #F7F7F7;overflow: hidden;width:100% ;}
.scoll{display: none;}
.item-inform{max-width:1000px ;margin:0px auto;background:#fff; margin-top: 20px;}
.item-inform{max-width:1000px ;margin:0px auto;background:#fff; margin-top: 20px; margin-bottom: 20px;}
.clearfixLeft{display:block;float: left;width:360px;}
.clearfixRight{width:calc(100% - 370px);margin-left:10px;}
.freight{width:400px;float: left;}
@ -479,4 +478,5 @@ ul.am-tabs-nav.am-nav.am-nav-tabs {left:20% ;max-width:960px ;margin-right: 0px;
@media only screen and (max-width:1025px)
{
ul.am-tabs-nav.am-nav.am-nav-tabs { width:100% !important; left: 0px !important; }
.detail { padding: 10px; }
}

View File

@ -1488,148 +1488,53 @@ $(document).ready(function() {
}
})
// 购买导航动画显示/隐藏
var temp_scroll = 0;
var scroll_type = -1;
var location_scroll = 0;
var nav_status = 1;
$(window).scroll(function()
{
var scroll = $(document).scrollTop();
if(scroll != temp_scroll)
if($(window).width() <= 625)
{
var temp_scroll_type = (scroll > temp_scroll) ? 1 : 0;
if(temp_scroll_type != scroll_type)
var scroll = $(document).scrollTop();
if(scroll != temp_scroll)
{
scroll_type = temp_scroll_type;
console.log('不一样了', scroll, temp_scroll, scroll_type, location_scroll)
location_scroll = scroll;
}
if(scroll_type == 1)
{
if(nav_status == 1 && scroll > location_scroll+200)
var temp_scroll_type = (scroll > temp_scroll) ? 1 : 0;
if(temp_scroll_type != scroll_type)
{
nav_status = 0;
console.log('隐藏导航');
//if(!$("div.pay").is(":visible"))
//{
$("div.pay").slideUp(500);
//}
scroll_type = temp_scroll_type;
location_scroll = scroll;
}
} else {
if(nav_status == 0 && scroll < location_scroll-100)
if(scroll_type == 1)
{
nav_status = 1;
console.log('打开导航');
$("div.pay").slideDown(500);
if(nav_status == 1 && scroll > location_scroll+200)
{
nav_status = 0;
if(!$("div.pay").is(":animated"))
{
$("div.pay").slideUp(500);
}
}
} else {
if(nav_status == 0 && scroll < location_scroll-100)
{
nav_status = 1;
if(!$("div.pay").is(":animated"))
{
$("div.pay").slideDown(500);
}
}
}
temp_scroll = scroll;
}
temp_scroll = scroll;
}
});
// 小导航
$(window).resize(function()
{
table_nav();
});
table_nav();
function table_nav()
{
// $(window).scroll(function()
// {
// if($(window).width() <= 1030)
// {
// var dv = $('ul.am-tabs-nav.am-nav.am-nav-tabs');
// if($(document).width(), dv.css('top') == '0px')
// {
// dv.css({'width': '100%'});
// }
// console.log($(document).width(), dv.css('top'));
// }
// });
}
//导航固定
// $(document).ready(function() {
// var $ww = $(window).width();
// var dv = $('ul.am-tabs-nav.am-nav.am-nav-tabs'),
// st;
// if ($ww < 623) {
// var tp =$ww+363;
// $(window).scroll(function() {
// st = Math.max(document.body.scrollTop || document.documentElement.scrollTop);
// if (st >= tp) {
// if (dv.css('position') != 'fixed') dv.css({
// 'position': 'fixed',
// 'top': 0,
// 'z-index': 1000009,
// 'width': '100%'
// });
// } else if (dv.css('position') != 'static') dv.css({
// 'position': 'static'
// });
// });
// //滚动条复位(需要减去固定导航的高度)
// $('.introduceMain ul li').click(function() {
// sts = tp;
// $(document).scrollTop(sts);
// });
// } else {
// dv.attr('otop', dv.offset().top); //存储原来的距离顶部的距离
// var tp = parseInt(dv.attr('otop'))+36;
// $(window).scroll(function() {
// st = Math.max(document.body.scrollTop || document.documentElement.scrollTop);
// if (st >= tp) {
// if (dv.css('position') != 'fixed') dv.css({
// 'position': 'fixed',
// 'top': 0,
// 'z-index': 998
// });
// //滚动条复位
// $('.introduceMain ul li').click(function() {
// sts = tp-35;
// $(document).scrollTop(sts);
// });
// } else if (dv.css('position') != 'static') dv.css({
// 'position': 'static'
// });
// });
// }
// });
$(document).ready(function() {
//优惠券
$(".hot span").click(function() {
$(".shopPromotion.gold .coupon").toggle();
})
//获得文本框对象
var t = $("#text_box");
//初始化数量为1,并失效减