Showing
2 changed files
with
122 additions
and
1 deletions
@@ -399,6 +399,127 @@ define('channel', function(require, exports) { | @@ -399,6 +399,127 @@ define('channel', function(require, exports) { | ||
399 | } | 399 | } |
400 | 400 | ||
401 | 401 | ||
402 | + | ||
403 | + // CtrlSwiper = function(option) { | ||
404 | + // this.swiper = option.swiper; | ||
405 | + // this.elem = $(option.elem); | ||
406 | + // this.slides = $(option.elem).find(option.slides); | ||
407 | + // this.nextButton = $(option.nextButton); | ||
408 | + // this.prevButton = $(option.prevButton); | ||
409 | + // this.slidesNum = 0; | ||
410 | + // this.slidesPerView = option.slidesPerView; | ||
411 | + // this.slideWitdh = option.slideWitdh; | ||
412 | + // this.groupWidth = option.perSlideWidth; | ||
413 | + // this.totalWidth = 0; | ||
414 | + // this.currentGroup = 0; | ||
415 | + // this.maxGroup = 0; | ||
416 | + // } | ||
417 | + | ||
418 | + // CtrlSwiper.prototype = { | ||
419 | + // constructor: CtrlSwiper, | ||
420 | + | ||
421 | + // slideTo: function(index) { | ||
422 | + // var group = Math.floor(index / this.slidesPerView); | ||
423 | + // if (group < 0 || group > this.maxGroup) { | ||
424 | + // return; | ||
425 | + // } | ||
426 | + | ||
427 | + // this.slideElem(this.elem, -group * this.groupWidth); | ||
428 | + // }, | ||
429 | + | ||
430 | + // slideElem: function(elem, width, time) { | ||
431 | + // time = time === undefined ? 0.3 : time; | ||
432 | + // elem.css("transform", "translate3d(" + width + "px, 0px, 0px)").css("transition-duration", time + "s"); | ||
433 | + // }, | ||
434 | + | ||
435 | + // init: function() { | ||
436 | + // var that = this, | ||
437 | + // swiper = this.detailCtrlSwiper, | ||
438 | + // i = 0, | ||
439 | + // len = 0, | ||
440 | + // groupCount = 0; | ||
441 | + | ||
442 | + // this.slidesNum = this.slides.size(); | ||
443 | + // this.groupWidth = this.slideWitdh * this.slidesPerView; | ||
444 | + | ||
445 | + // for (i = 0, len = this.slides.length; i < len; i++) { | ||
446 | + // if (i % 2 === 0) { | ||
447 | + // if (/big-size/.test(this.slides[i].className)) { | ||
448 | + // group++; | ||
449 | + // } else if () | ||
450 | + // } | ||
451 | + | ||
452 | + | ||
453 | + // if (i + 1 < len) { | ||
454 | + // if (/big-size/.test(this.slides[i+1].className)) { | ||
455 | + // this.slides[i].css("width", "1140px"); | ||
456 | + // group++; | ||
457 | + // } else { | ||
458 | + | ||
459 | + // } | ||
460 | + // } | ||
461 | + // } | ||
462 | + | ||
463 | + | ||
464 | + // // this.totalWidth = this.slidesNum * this.slideWitdh; | ||
465 | + | ||
466 | + | ||
467 | + // this.maxGroup = Math.floor(this.slidesNum / this.slidesPerView); | ||
468 | + // this.elem.css("width", this.totalWidth + "px"); | ||
469 | + | ||
470 | + // // if (this.slidesNum <= 5) { | ||
471 | + // // $(".detail-slide-ctrl-prev").hide(); | ||
472 | + // // $(".detail-slide-ctrl-next").hide(); | ||
473 | + // // } | ||
474 | + | ||
475 | + // this.prevButton.on("click", function() { | ||
476 | + // if ((that.currentGroup - 1) >= 0) { | ||
477 | + // that.slideElem(that.elem, -(that.currentGroup - 1) * that.groupWidth); | ||
478 | + // that.currentGroup--; | ||
479 | + // } else { | ||
480 | + // that.slideElem(that.elem, -that.maxGroup * that.groupWidth, 0.1); | ||
481 | + // that.currentGroup = that.maxGroup; | ||
482 | + // } | ||
483 | + // }); | ||
484 | + | ||
485 | + // this.nextButton.on("click", function() { | ||
486 | + // if ((that.currentGroup + 1) <= that.maxGroup) { | ||
487 | + // that.slideElem(that.elem, -(that.currentGroup + 1) * that.groupWidth); | ||
488 | + // that.currentGroup++; | ||
489 | + // } else { | ||
490 | + // that.slideElem(that.elem, 0, 0.1); | ||
491 | + // that.currentGroup = 0; | ||
492 | + // } | ||
493 | + | ||
494 | + // }); | ||
495 | + | ||
496 | + // this.slides.on("click", function() { | ||
497 | + // var index = $(this).index(this.slides); | ||
498 | + | ||
499 | + // $(".detail-slide-ctrl-tabs .box").find(".cover").removeClass("on"); | ||
500 | + // $(this).find(".cover").addClass("on"); | ||
501 | + // detailSwiper.swipeTo(index); | ||
502 | + // }); | ||
503 | + | ||
504 | + // $(this.slides[0]).click(); | ||
505 | + // } | ||
506 | + // } | ||
507 | + | ||
508 | + // var ctrlTabs = new CtrlSwiper({ | ||
509 | + // elem: ".cooperation .slide-wrap", | ||
510 | + // slides: ".box", | ||
511 | + // prevButton: ".cooperation .cooperation-slide-prev", | ||
512 | + // nextButton: ".cooperation .cooperation-slide-next", | ||
513 | + // slidesPerView: 1, | ||
514 | + // slideWitdh: 1180 | ||
515 | + // }); | ||
516 | + | ||
517 | + // ctrlTabs.init(); | ||
518 | + | ||
519 | + | ||
520 | + | ||
521 | + | ||
522 | + | ||
402 | /** | 523 | /** |
403 | * 首页底部合作商滑动条 | 524 | * 首页底部合作商滑动条 |
404 | */ | 525 | */ |
@@ -1139,7 +1139,7 @@ define('yohood', function(require, exports) { | @@ -1139,7 +1139,7 @@ define('yohood', function(require, exports) { | ||
1139 | $(window).on('scroll', function() { | 1139 | $(window).on('scroll', function() { |
1140 | relatedH = relatedPost.outerHeight(); | 1140 | relatedH = relatedPost.outerHeight(); |
1141 | maxH = $('.yoho-nav').outerHeight() + $('.header').outerHeight() + $('.bd').outerHeight(); | 1141 | maxH = $('.yoho-nav').outerHeight() + $('.header').outerHeight() + $('.bd').outerHeight(); |
1142 | - if ($(this).scrollTop() >= relatedTop) { | 1142 | + if ($(this).scrollTop() >= relatedTop - 50) { |
1143 | relatedPost.addClass('fix'); | 1143 | relatedPost.addClass('fix'); |
1144 | if (relatedPost.offset().top + relatedH >= maxH && relatedPost.hasClass('fix')) { | 1144 | if (relatedPost.offset().top + relatedH >= maxH && relatedPost.hasClass('fix')) { |
1145 | relatedPost.css({ | 1145 | relatedPost.css({ |
-
Please register or login to post a comment