Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOOD
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
microTT
9 years ago
Commit
46e48c4082cfa7a16b5da94aceadd5110350a313
1 parent
d4e5e5ee
详情页最新视频/资讯开始滑动位置修改
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
1 deletions
res/js/channel.js
res/js/yohood.js
res/js/channel.js
View file @
46e48c4
...
...
@@ -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();
/**
* 首页底部合作商滑动条
*/
...
...
res/js/yohood.js
View file @
46e48c4
...
...
@@ -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
({
...
...
Please
register
or
login
to post a comment