You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
116 lines
3.9 KiB
116 lines
3.9 KiB
$(function(){
|
|
function banner_show_track(i)
|
|
{
|
|
//$.getJSON("/api/recommend_stats/banner?t=s&data_id="+i+"&callback=?", function(e){});
|
|
}
|
|
// banner_show_track($('.banner-mark:first').attr('data-id'));
|
|
jQuery("#banner").slide({
|
|
effect: "fade",
|
|
easing: "swing",
|
|
interTime: "4000",
|
|
delayTime: "500",
|
|
trigger: 'click',
|
|
autoPlay: true,
|
|
pnLoop: true,
|
|
titCell: ".hd li",
|
|
mainCell: ".bd ul",
|
|
titOnClassName: "current",
|
|
prevCell:" .prevBtn",
|
|
nextCell:" .nextBtn",
|
|
startFun: function (i, c) {
|
|
var li = $('#banner .bd ul li').eq(i);
|
|
if ($(li).find("span").attr('show') == 0) {
|
|
$(li).find("span").css({
|
|
'background': 'url(' + $(li).find("span").attr("url") + ') no-repeat center',
|
|
'display': 'block',
|
|
'width': '100%',
|
|
'height': '100%'
|
|
}).attr('show', 1);
|
|
// banner_show_track($('.banner-mark').eq(i).attr('data-id'));
|
|
}
|
|
}
|
|
});
|
|
$('.banner-mark').each(function() {
|
|
var data_id = $(this).attr('data-id');
|
|
//$(this).one('click', function(){
|
|
// $.getJSON("/api/recommend_stats/banner?t=e&data_id="+data_id+"&callback=?", function(e){});
|
|
//});
|
|
});
|
|
$('.zhuanti-mark').each(function() {
|
|
var data_id = $(this).attr('data-id');
|
|
// $(this).one('click', function(){
|
|
//$.getJSON("/api/recommend_stats/zhuanti?data_id="+data_id+"&callback=?", function(e){});
|
|
// });
|
|
});
|
|
$(".b-box .s-box").each(function() {
|
|
var data_id = $(this).find('.b-collect').attr('pid');
|
|
//$(this).one('click', function(){
|
|
// $.getJSON("/api/recommend_stats/pic?data_id="+data_id+"&callback=?", function(e){});
|
|
//});
|
|
});
|
|
|
|
$('#keyword').focus(function(){
|
|
$(this).parent().css('opacity',1);
|
|
});
|
|
|
|
$('.pa').click(function(){
|
|
var kid = $(this).attr('typeid');
|
|
$('#keyword').attr('key-type',kid);
|
|
$('.search-btn').attr('key-type',kid);
|
|
$('.pa').removeClass('pchose');
|
|
$(this).addClass('pchose');
|
|
var name = $(this).attr('name');
|
|
var searchname = '搜索精品'+name;
|
|
$('.i-search').attr('placeholder',searchname);
|
|
var num = $('.pa').length;
|
|
var thisnum = parseInt($(this).attr('typeid'));
|
|
$('.pline').removeClass('plinenone');
|
|
if(thisnum ==1){
|
|
$(this).next().addClass('plinenone');
|
|
}
|
|
if(thisnum>1 && thisnum<=7){
|
|
$(this).prev().addClass('plinenone');
|
|
$(this).next().addClass('plinenone');
|
|
}
|
|
if(thisnum == num){
|
|
$(this).prev().addClass('plinenone');
|
|
}
|
|
});
|
|
|
|
$('.leftbar a').on('click', function() {
|
|
var anchor = $(this).attr('data');
|
|
if(anchor ==''){
|
|
return false;
|
|
}
|
|
$('body,html').stop().animate({
|
|
scrollTop: $(anchor).offset().top
|
|
}, 400);
|
|
return false;
|
|
});
|
|
|
|
$(window).scroll(function() {
|
|
var scrollTop = $(document).scrollTop();
|
|
var tops = parseInt($('.footer').offset().top)-900;
|
|
if(scrollTop>280 && scrollTop<tops) {
|
|
$(".leftbar").show();
|
|
}
|
|
else {
|
|
$(".leftbar").hide();
|
|
}
|
|
|
|
$('.jptitle').each(function(i, v) {
|
|
if (scrollTop > (parseInt($(v).offset().top)-800)) {
|
|
$('.lboxchose').removeClass('divchose');
|
|
$('[data-nav=' + i + ']').addClass('divchose');
|
|
}
|
|
if(scrollTop<= parseInt($('#pptjp').offset().top)){
|
|
$('[data-nav=0]').addClass('divchose');
|
|
}
|
|
});
|
|
|
|
});
|
|
$('.box-new-hot li').mouseenter(function(){
|
|
$(this).addClass('on').siblings().removeClass('on');
|
|
$('.boxinfo .box-inner').eq($(this).index()).show().siblings().hide();
|
|
});
|
|
});
|