Authored by 周奇琪

修复一些问题

... ... @@ -22,7 +22,8 @@ var flip = require("./flip");
ContentPaging.DEFAULTS = {
coverPic:".pic-body",
pageContentWrap:".text-body"
pageContentWrap:".text-body",
callback:null
};
... ... @@ -31,10 +32,12 @@ var flip = require("./flip");
init:function(){
//this.$contentWrap.text(this.$contentWrap.html());
if(this.len ==0) return;
this._browserjuge();
this._creat();
this._bindEvent();
this.pagination(0);
},
//兼容ie8
... ... @@ -72,6 +75,7 @@ var flip = require("./flip");
* 分页函数
*/
pagination: function(index) {
var _this = this;
if(this.len<=1) return;
//除了第一页,均不显示封面图
if(index == 0){
... ... @@ -83,6 +87,21 @@ var flip = require("./flip");
$(".detail-pagination .channel-index-pager").find("a").removeClass("pager-item-choosen").eq(index).addClass("pager-item-choosen");
$("body").animate({scrollTop:0},10);
$(document.documentElement).animate({scrollTop:0},10);
slide.initSlide({isMobile:false});
flip.init({
operate:"mouse",
wrapClass:".yohoboy-flip"
});
if(this.options.callback){
clearTimeout(timer);
var timer = null;
timer = setTimeout(function(){
_this.options.callback();
},500);
}
},
... ...
... ... @@ -5,6 +5,7 @@
*/
var $ = require("jquery");
require("yoho-rotate2d");
require('jquery.imagesloaded'); //懒加载
var height;
var scrollTop;
var windowHeight=$(window).height();
... ... @@ -14,6 +15,7 @@ function RevolvePic(target){
//延时对象
var timeHandler1,timeHandler2,timeHandler3,timeHandler4;
var Y = target.offset().top;
target.height(target.find("img:first").height());
height=target.height();
//分别判断图片小于屏幕和大于屏幕的情况
var last=target.find("a[pic='last']");//第二章图片对象
... ... @@ -108,7 +110,7 @@ exports.init=function(info){
var opts = $.extend(defaults, info);
var targets=null;
targets=$(opts.wrapClass);
height=opts.height ;
height=opts.height;
delay=opts.delay;
returnDelay=opts.returnDelay;
//当前滚动条的位置
... ... @@ -119,16 +121,21 @@ var isStayLong=false;
if(opts.operate=="auto")
{
//获取到前后面的图片
targets.each(function(index,obj){
RevolvePic($(obj));
var isImagesLoaded=false;
targets.find("img:first").imagesLoaded(function(){
isImagesLoaded=true;
RevolvePic($(this).parent().parent());
});
$(window).scroll(function(){
if(isImagesLoaded===true){
scrollTop=$(document).scrollTop();
targets.each(function(index,obj){
RevolvePic($(obj));
});
});
};
});
}
else if(opts.operate=="mouse")
{
... ... @@ -150,4 +157,4 @@ else if(opts.operate=="mouse")
});
}
};
\ No newline at end of file
}
\ No newline at end of file
... ...
... ... @@ -8,9 +8,7 @@ var $=require("jquery");
require("jquery.imagesloaded");
var tmpInfo=null;
window.onresize=function(){
if (tmpInfo!=null) {
exports.initSlide(tmpInfo);
}
exports.initSlide(tmpInfo);
}
exports.initSlide=function(info){
... ... @@ -38,7 +36,6 @@ exports.initSlide=function(info){
imgs[tmpId]=$(this).attr("src");
maxWidth[tmpId]=$(this).width();
maxHeight[tmpId]=$(this).height();
$(obj).find(".photoslider_left_image img").css({
"max-width":maxWidth[tmpId],
"max-height":maxHeight[tmpId],
... ...
/**
* @author DELL
*/
/**
/*
* @fileOverview 弹出层组件
* @author:王威
* @date:2014-09-19
... ... @@ -79,7 +79,7 @@ exports.init=function(info){
try {
} catch (e) {
}
var f = 'http://v.t.sina.com.cn/share/share.php?', u = options.shareUrl, p = ['url=', e(u), '&title=', e(window.sharetitle+' @YOHO潮流志'), '&appkey=2924220432', '&pic=', e(window.shareUrl)].join('');
var f = 'http://v.t.sina.com.cn/share/share.php?', u = options.shareUrl, p = ['url=', e(u), '&title=', e(window.sharetitle+' @YOHO潮流志'), '&appkey=3910025296', '&pic=', e(window.shareUrl)].join('');
function a() {
if (!window.open([f, p].join(''), 'mb', ['toolbar=0,status=0,resizable=1,width=620,height=450,left=', (s.width - 620) / 2, ',top=', (s.height - 450) / 2].join('')))
u.href = [f, p].join('');
... ... @@ -167,8 +167,8 @@ exports.init=function(info){
});
$(".yohoo-share-button-qq").unbind().on("click",function(){
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+ encodeURIComponent(location.href)+
'&title='+options.qqText+
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+ options.shareUrl+
'&title='+options.qqText+'&summary= '+
'&pics='+options.img,'_blank','height='+options.height+',width='+options.width+',left='+iLeft+',top='+iTop);
});
};
... ... @@ -194,4 +194,3 @@ $(".bottom-content").on("click.closeWxDialog",function(){
$(".enterprise").on("click.closeWxDialog",function(){
$(".detail-container").trigger("click.closeWxDialog");
})
... ...
var dic=require("./DicTips");
exports.getTips=function(key){
if(isJian())
... ...