Authored by tmq

Merge branch 'develop' of git.dev.yoho.cn:web/yohood into develop

... ... @@ -399,6 +399,127 @@ define('channel', function(require, exports) {
}
// CtrlSwiper = function(option) {
// this.swiper = option.swiper;
// this.elem = $(option.elem);
// this.slides = $(option.elem).find(option.slides);
// this.nextButton = $(option.nextButton);
// this.prevButton = $(option.prevButton);
// this.slidesNum = 0;
// this.slidesPerView = option.slidesPerView;
// this.slideWitdh = option.slideWitdh;
// this.groupWidth = option.perSlideWidth;
// this.totalWidth = 0;
// this.currentGroup = 0;
// this.maxGroup = 0;
// }
// CtrlSwiper.prototype = {
// constructor: CtrlSwiper,
// slideTo: function(index) {
// var group = Math.floor(index / this.slidesPerView);
// if (group < 0 || group > this.maxGroup) {
// return;
// }
// this.slideElem(this.elem, -group * this.groupWidth);
// },
// slideElem: function(elem, width, time) {
// time = time === undefined ? 0.3 : time;
// elem.css("transform", "translate3d(" + width + "px, 0px, 0px)").css("transition-duration", time + "s");
// },
// init: function() {
// var that = this,
// swiper = this.detailCtrlSwiper,
// i = 0,
// len = 0,
// groupCount = 0;
// this.slidesNum = this.slides.size();
// this.groupWidth = this.slideWitdh * this.slidesPerView;
// for (i = 0, len = this.slides.length; i < len; i++) {
// if (i % 2 === 0) {
// if (/big-size/.test(this.slides[i].className)) {
// group++;
// } else if ()
// }
// if (i + 1 < len) {
// if (/big-size/.test(this.slides[i+1].className)) {
// this.slides[i].css("width", "1140px");
// group++;
// } else {
// }
// }
// }
// // this.totalWidth = this.slidesNum * this.slideWitdh;
// this.maxGroup = Math.floor(this.slidesNum / this.slidesPerView);
// this.elem.css("width", this.totalWidth + "px");
// // if (this.slidesNum <= 5) {
// // $(".detail-slide-ctrl-prev").hide();
// // $(".detail-slide-ctrl-next").hide();
// // }
// this.prevButton.on("click", function() {
// if ((that.currentGroup - 1) >= 0) {
// that.slideElem(that.elem, -(that.currentGroup - 1) * that.groupWidth);
// that.currentGroup--;
// } else {
// that.slideElem(that.elem, -that.maxGroup * that.groupWidth, 0.1);
// that.currentGroup = that.maxGroup;
// }
// });
// this.nextButton.on("click", function() {
// if ((that.currentGroup + 1) <= that.maxGroup) {
// that.slideElem(that.elem, -(that.currentGroup + 1) * that.groupWidth);
// that.currentGroup++;
// } else {
// that.slideElem(that.elem, 0, 0.1);
// that.currentGroup = 0;
// }
// });
// this.slides.on("click", function() {
// var index = $(this).index(this.slides);
// $(".detail-slide-ctrl-tabs .box").find(".cover").removeClass("on");
// $(this).find(".cover").addClass("on");
// detailSwiper.swipeTo(index);
// });
// $(this.slides[0]).click();
// }
// }
// var ctrlTabs = new CtrlSwiper({
// elem: ".cooperation .slide-wrap",
// slides: ".box",
// prevButton: ".cooperation .cooperation-slide-prev",
// nextButton: ".cooperation .cooperation-slide-next",
// slidesPerView: 1,
// slideWitdh: 1180
// });
// ctrlTabs.init();
/**
* 首页底部合作商滑动条
*/
... ...
... ... @@ -1129,7 +1129,7 @@ define('yohood', function(require, exports) {
$(".side-related-list").eq(0).html(lastNews);
$(".side-related-list").eq(1).html(hotVideo);
if ($('.detail-body').outerHeight() > $('.detail-side').outerHeight() && navigator.userAgent.indexOf('iPad') === -1) {
if ($('.page-detail-body').outerHeight() > $('.page-detail-side').outerHeight() && navigator.userAgent.indexOf('iPad') === -1) {
//右侧相关文章定位
relatedPost = $('.side-related-post');
relatedTop = relatedPost.offset().top;
... ... @@ -1139,7 +1139,7 @@ define('yohood', function(require, exports) {
$(window).on('scroll', function() {
relatedH = relatedPost.outerHeight();
maxH = $('.yoho-nav').outerHeight() + $('.header').outerHeight() + $('.bd').outerHeight();
if ($(this).scrollTop() >= relatedTop) {
if ($(this).scrollTop() >= relatedTop - 50) {
relatedPost.addClass('fix');
if (relatedPost.offset().top + relatedH >= maxH && relatedPost.hasClass('fix')) {
relatedPost.css({
... ...