欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

腾讯的这个JS幻灯太难扣了,求高人指点。。。_html/css_WEB-ITnose

程序员文章站 2022-04-15 11:37:56
...
JS幻灯,扣JS JavaScript 腾讯 领导看中了腾讯的这个JS幻灯,有那么多的JS焦点图效果不用,非要用这个。没办法我只的去扣了,可以昨天搞了一下午都没扣出来,最后扣出来了,可还有问题,就是不能加载下一张图片,还请高手帮我扣下这个JS代码。我相信一定有高手会扣的。先感谢下。
http://hb.qq.com/a/20130424/001756.htm
这个就是腾讯的JS幻灯。


回复讨论(解决方案)

他的js 很多都是 动态加载的 你很难搞到他的 真正的 控制的js 数据也是动态加载了 你自己写吧 亲

他的js 很多都是 动态加载的 你很难搞到他的 真正的 控制的js 数据也是动态加载了 你自己写吧 亲
你扣一上午你不如自己写个


他的js 很多都是 动态加载的 你很难搞到他的 真正的 控制的js 数据也是动态加载了 你自己写吧 亲
你扣一上午你不如自己写个

自己写是可以写一个出来,可是没有达到腾讯的那种水平和美术功底啊,人家做的漂亮,用户体验也好

他的js 很多都是 动态加载的 你很难搞到他的 真正的 控制的js 数据也是动态加载了 你自己写吧 亲

那大哥你可以搞到他的JS吗?


他的js 很多都是 动态加载的 你很难搞到他的 真正的 控制的js 数据也是动态加载了 你自己写吧 亲

那大哥你可以搞到他的JS吗?
我也扣不出来,呵呵,最后还是自己找的jquery插件搞的

PART--01

/*json文件开始*/JSON=new function(){this.decode=function(){var filter,result,self,tmp;if($$("toString")){switch(arguments.length){case 2:self=arguments[0];filter=arguments[1];break;case 1:if($[typeof arguments[0]](arguments[0])===Function){self=this;filter=arguments[0]}else self=arguments[0];break;default:self=this;break};if(rc.test(self)){try{result=e("(".concat(self,")"));if(filter&&result!==null&&(tmp=$[typeof result](result))&&(tmp===Array||tmp===Object)){for(self in result)result[self]=v(self,result)?filter(self,result[self]):result[self]}}catch(z){}}else{throw new JSONError("bad data");}};return result};this.encode=function(){var self=arguments.length?arguments[0]:this,result,tmp;if(self===null)result="null";else if(self!==undefined&&(tmp=$[typeof self](self))){switch(tmp){case Array:result=[];for(var i=0,j=0,k=self.length;j= 1) {		indexPic = arguments[0];		}		window.document.setSoScreen.loadFullScreen(loadingProcess.datas, indexPic);		} else {		setTimeout("loadingProcess.setPicHandler()", 300);		}	},	addSwfHandler : function () {		var sofull = new SWFObject(loadingProcess.swfUrl, "setSoScreen", "48", "12", "9.0.28", "#000000");		sofull.addParam("allowNetworking", "all");		sofull.addParam("allowScriptAccess", "always");		sofull.addParam("allowFullScreen", "true");		sofull.addParam("wmode", "window");		sofull.addVariable("fristTips", "第一张");		sofull.addVariable("lastTips", "最后一张");		sofull.addVariable("gotoUrl",loadingProcess.sitePicUrl);		sofull.addVariable("picUrl",loadingProcess.lastUrl);		sofull.write(loadingProcess.divName);	},	setTitle : function() {		var title = document.title.replace(/#p.\d/i,"");		document.title = title;	},	callByFullScreen : function (indexId, isExiting) {		var deDatas = JSON.decode(loadingProcess.datas);		hdPic.fn._showBig(deDatas,indexId);	},	setFullScreenDatas:function (data) {		loadingProcess.datas = JSON.encode(data);	},	initSystems : function (){		loadingProcess.addSwfHandler();	}};

PART--02

var hdPic = window.hdPic = function(p){		return hdPic.fn.init(p);	};hdPic.fn=hdPic.prototype = {	_tmpArray:[],	_lastUrl:"",	_lastTitle:"",	_isgoOn:false,	_coentArray:"",	_coreurl:"http://mat1.gtimg.com/www/core/core_v1.5.1.js",	_pageNow:0,	_isMove:false,	_dragx:0,	_isAuto:false,	_autoTimer:null,	_nowSrc:new Image(),	_preloadN:new Image(),	_preloadP:new Image(),	_sourName:"",	_sourUrl:"",	_pubTime:"",	_siteName:"",	_siteLink:"",	_isPic:true,	_isCiment:false,	_aid:0,	_siteEname:"news",	_auth:"",	_specificID:"",	_record : false,	_clickSum : 0,	_tempTime : null,	_isDoc : false,	_isAD : false,	_AD_id : '',	_listLen : 7,	_coreload:function(file,callback) {		try {			var script = document.createElement('script');			script.src = file;			script.type = "text/javascript";			document.getElementsByTagName("head")[0].appendChild(script);			if( script.addEventListener ) {			script.addEventListener("load", callback, false);			} else if(script.attachEvent) {			script.attachEvent("onreadystatechange", function(){				if(script.readyState == 4				|| script.readyState == 'complete'				|| script.readyState == 'loaded') {				callback();				}			});			}		} catch(e) {		callback();	}},_getReady:function(){//大图首次载入ready,初始化播放器区域高度,图片切换效果、hover效果	$(".pageLeft-bg").show();	$(".pageRight-bg").show();	$(".pageLeft").height($("#Main-A").height());	$(".pageLeft span").css("marginTop",parseInt(($("#Main-A").height()-95)/2));	$(".pageLeft-bg").height($("#Main-A").height());	$(".pageRight").height($("#Main-A").height());	$(".pageRight span").css("marginTop",parseInt(($("#Main-A").height()-95)/2));	$(".pageRight-bg").height($("#Main-A").height());	$("#mouseOverleft").height($("#Main-A").height());	$("#mouseOverleft").width(parseInt($("#Main-A").width()/2));	$("#mouseOverright").height($("#Main-A").height());	$("#mouseOverright").width(parseInt($("#Main-A").width()/2));	$("#mouseOverleft").hover(function(){	$(".pageLeft").fadeIn("fast");	$(".pageLeft").attr("title","点击浏览上一张图片,支持'←'翻页");	},function(){	$(".pageLeft").fadeOut("fast");	$(".pageLeft").attr("title","");	});	$("#mouseOverright").hover(function(){	$(".pageRight").fadeIn("fast");	$(".pageRight").attr("title","点击浏览下一张图片,支持'→'翻页");	},function(){	$(".pageRight").fadeOut("fast");	$(".pageRight").attr("title","");	});	if($("#Main-D").css("display")=="block"){	$("#Main-D").fadeTo('slow',1).fadeTo('slow',0.2).fadeTo('slow',1);	}	$("#Main-C").fadeTo('slow',1).fadeTo('slow',0.2).fadeTo('slow',1);	},	nowSite : function(){	var siteName = window.location.href, siteN=siteName.match(/http:\/\/([^\/]+)\//i)[1], nowSite=siteN.split(".")[0];	return nowSite;	},	secondSite : function(){	var siteName = window.location.href, siteN=siteName.match(/http:\/\/([^\/]+)\//i)[1], secondSite=siteN.split(".")[1];	return secondSite;},//不显示默认末页广告的频道NoAdChannel : 'news, finance,kid,gd,gz,sz,zh,cd,xian,fj,cq,henan,2012,hn,hb,sh,zj',//频道单独末页广告{name|adName}ChannelAd : ['gd|gd_zutu_gaoqing_pic','gz|gd_zutu_gaoqing_pic','sz|gd_zutu_gaoqing_pic','zh|gd_zutu_gaoqing_pic','cd|cd_zutu_gaoqing_pic','xian|xian_zutu_gaoqing_pic','fj|fj_zutu_gaoqing_pic','cq|cq_zutu_gaoqing_pic','hb|hb_zutu_gaoqing_pic','henan|hn_zutu_gaoqing_pic','2012|Sports_AY_GQZT_ZHYZ','hn|Hunan_zutu_gaoqing_pic','sh|SH_zutu_gaoqing_pic','hb|HB_Zutu_Width1','zj|ZJ_zutu_gaoqing_pic', 'hb|hb_zutu_gaoqing_pic'],_createAD : function(){var _this = this;var lastAD = $('#lastAD'), html = '';var isShowAD = false;if(this.nowSite() == 'news' && hdPic.fn._isShowLastAD && hdPic.fn._isShowLastAD == 1){isShowAD = true;}if(this.NoAdChannel.indexOf(_this.nowSite())==-1 || isShowAD ){this._AD_id = 'gaoqing_F_pic';html = '';}else{$.each(this.ChannelAd, function(o){if(this.split('|')[0] == _this.nowSite()){html = '';_this._AD_id = this.split('|')[1];}});}lastAD.html(html);},_buttonAD : function(){var _this = this, mainC = $('#Main-C'), BtnAdSite = '',//显示Button广告的频道_buttonAdHtml = '
'+'
'+''+'
'+'
    loading..
'+''+'
'+''+'
'+'
'+'
'+'
';if(new RegExp(_this.nowSite(), 'gi').test(BtnAdSite)){mainC.html(_buttonAdHtml);mainC.addClass('btnAd');crystal.request('gaoqing_F_slt_button');this._listLen = 5;}else{mainC.addClass('noBtnAd');this._listLen = 7;}},_lastAD:function(data,siteN){var _self = this, lastAD = $('#lastAD');$("#lastAD").css({'left':parseInt($("#Main-A").offset().left+($("#Main-A").width()/2-$("#end").width()/2))+'px','top':parseInt($("#Main-A").offset().top+114)+'px','z-index':'999'});if(this._AD_id){$("#lastAD").css('display','block');//准备好广告位crystal.getArea(this._AD_id).invoke('open');}setTimeout(function(){//末页推荐延迟100ms_self._showLast(data,siteN)},100);},_insetAD : function(){var _this = this, insetAD = $('#insetAD'), NoInsetAdSite = 'news, finance, house',//不显示插页广告的频道_insetAdHtml = '';if(NoInsetAdSite.indexOf(_this.nowSite()) == -1 && _this.secondSite() != 'house'){insetAD.html(_insetAdHtml);}},_getLast:function(data){//末页推荐var siteName = window.location.href;var siteN=siteName.match(/http:\/\/([^\/]+)\//i)[1];this._lastAD(data,siteN);},_showLast:function(data,siteN){this.AD = true;$("#end").css("left",parseInt(($("#Main-A").width()/2-$("#end").width()/2))+"px");$("#Main-A").height($("#Main-A").height());$("#end").animate({top:"114px"},"slow",function(){$(".pageLeft").height($("#Main-A").height());$(".pageLeft span").css("marginTop",parseInt(($("#Main-A").height()-95)/2));$(".pageLeft-bg").height($("#Main-A").height());$(".pageRight").height($("#Main-A").height());$(".pageRight span").css("marginTop",parseInt(($("#Main-A").height()-95)/2));$(".pageRight-bg").height($("#Main-A").height());$("#mouseOverleft").height($("#Main-A").height());$("#mouseOverright").height($("#Main-A").height());});$(".firstImg").html("腾讯的这个JS幻灯太难扣了,求高人指点。。。_html/css_WEB-ITnose");$("h2").html($("h1").html());$("#replayPic").bind("click",function(){hdPic.fn._hideLast();hdPic.fn._pageNow = 0;hdPic.fn._showBig(data,hdPic.fn._pageNow);});$("a.close").bind("click",function(){hdPic.fn._hideLast();hdPic.fn._showBig(data,hdPic.fn._pageNow);});$("#end .ft").append('手机客户端 读图新体验');this._getThreepic();$(".buttonClik").attr("href",hdPic.fn._siteLink);if(hdPic.fn._isPic){$(".buttonClik").html("进入"+hdPic.fn._siteName+"图片中心");}else{$(".buttonClik").html("进入"+hdPic.fn._siteName+"首页");}if(siteN.split(".")[0] == "finance" || siteN.split(".")[0] == "kid"){$("#lastAD").hide();}else{setTimeout(function(){//5s后判断广告层是否存在$("#lastAD").hide();},5000);}},_hideLast:function(){//隐藏末页推荐var _this = this;this._isAD = false;$("#end").animate({top:"-528px"},"slow",function(){$(".pageLeft").height($("#Main-A").height());$(".pageLeft span").css("marginTop",parseInt(($("#Main-A").height()-95)/2));$(".pageLeft-bg").height($("#Main-A").height());$(".pageRight").height($("#Main-A").height());$(".pageRight span").css("marginTop",parseInt(($("#Main-A").height()-95)/2));$(".pageRight-bg").height($("#Main-A").height());$("#mouseOverleft").height($("#Main-A").height());$("#mouseOverright").height($("#Main-A").height());$("#lastAD").hide();});},_getThreepic:function(){//调用末页推荐最后3张图var tmp = "",newLength = 3;if(typeof lastPic_hd !=="undefined"){if (lastPic_hd.length == 3) {for (var i = 0; i 20){title = lastPic_hd[i].Title.substring(0,19)+"...";}tmp += '
  • ';}$("#lastComend").html(tmp);$("#lastComend div:eq(0)").css("float","left");$("#lastComend div:eq(2)").css("float","right");return false;} else {if (lastPic_hd.length !== 0) {for (var i = 0; i 20){title = lastPic_hd[i].Title.substring(0,19)+"...";}tmp += '
  • ';;}}newLength = 3 - lastPic_hd.length;}

    PART--03

    $.ajax({url: "/c/otherPic.js",type: "GET",beforeSend: function(x) {x.setRequestHeader("If-Modified-Since","0");x.setRequestHeader("Charset", "GB2312");x.setRequestHeader("Cache-Control","no-cache");},success: function() {var arrMe = eval("(" + arguments[0] + ")")[0].root;for (i = 0; i 20){title = arrMe[i].article[1].title.substring(0,19)+"...";}tmp += '
  • ';}$("#lastComend").html(tmp);$("#lastComend div:eq(0)").css("float","left");$("#lastComend div:eq(2)").css("float","right");}});}else{$.ajax({url: "/c/otherPic.js",type: "GET",beforeSend: function(x) {x.setRequestHeader("If-Modified-Since","0");x.setRequestHeader("Charset", "GB2312");x.setRequestHeader("Cache-Control","no-cache");},success: function() {var arrMe = eval("(" + arguments[0] + ")")[0].root;for (i = 0; i 20){title = arrMe[i].article[1].title.substring(0,19)+"...";}tmp += '
  • ';}$("#lastComend").html(tmp);$("#lastComend div:eq(0)").css("float","left");$("#lastComend div:eq(2)").css("float","right");}});}},_clickleft:function(data){//向前点if(hdPic.fn._pageNow>0){hdPic.fn._pageNow--;hdPic.fn._showBig(data,hdPic.fn._pageNow);}else{hdPic.fn._pageNow = 0;return;}},_clickright:function(data){//向后点if(hdPic.fn._pageNow_this._listLen){$(".scrollButton").bind("selectstart",function(){return false;})$(".scrollButton").click(function(){}).mousedown(function(e){_this._isDoc = true;hdPic.fn._stopAuto();//设置捕获范围if($(".scrollButton").setCapture){$(".scrollButton").setCapture();}else if(window.captureEvents){window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);}hdPic.fn._isMove = true;hdPic.fn._dragx = e.pageX-parseInt($(".scrollButton").css("left"));$(".scrollButton").fadeTo(20, 0.5);$("a.mask").hide();});$(document).mousemove(function(e){if(hdPic.fn._isMove){var x=Math.max(0, Math.min(e.pageX-hdPic.fn._dragx,_this._listLen*110));$(".scrollButton").css({left:x});hdPic.fn._dragmov();}}).mouseup(function(){hdPic.fn._isMove=false;//取消捕获范围if($(".scrollButton").releaseCapture){$(".scrollButton").releaseCapture();}else if(window.captureEvents){window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);}$(".scrollButton").fadeTo("fast", 1);if(parseInt($("#Smailllist").css("left"))%131!==0 && _this._isDoc){var argleft = parseInt($("#Smailllist").css("left"));$("#Smailllist").animate({left:argleft+(Math.abs(parseInt($("#Smailllist").css("left"))%131))+"px"},"fast");};_this._isDoc = false;})};//自动播放$(".play").click(function(){if(!hdPic.fn._isAuto){hdPic.fn._autoplay(data);}else{hdPic.fn._stopAuto();}});//快捷键$(document).bind("keydown",function(e){e = window.event || e;hdPic.fn._stopAuto();e.keyCode == 37 && hdPic.fn._clickleft(data);e.keyCode == 39 && hdPic.fn._clickright(data);//e.keyCode == 38 && hdPic.fn._clickleft(data);//e.keyCode == 40 && hdPic.fn._clickright(data);});//焦点var scrollPos;if(typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {scrollPos = document.documentElement;}else if (typeof document.body != 'undefined') {scrollPos = document.body;}var _topnav = $("#toolBar").offset().top;$(scrollPos).animate({scrollTop:_topnav - 10}, 1000);},_stopAuto:function(){//停止自动播放$(".play").html("幻灯播放");$(".play").removeClass("stop");hdPic.fn._isAuto = false;window.clearInterval(hdPic.fn._autoTimer);},_autoplay:function(data){//自动播放$(".play").html("停止播放");$(".play").addClass("stop");hdPic.fn._isAuto = true;this._autoTimer = window.setInterval(function(){if(hdPic.fn._pageNow"+hdPic.fn._sourName+"":""+hdPic.fn._sourName+"";var zuozhe = hdPic.fn._auth!==""?""+hdPic.fn._auth+"":"";if(this._tmpArray[n].showtit==""){$("#Main-B").html('
    '+hdPic.fn._pubTime+''+sours+''+zuozhe+'
    ');//图注装载}else{$("#Main-B").html('

    '+this._tmpArray[n].showtit+'

    '+hdPic.fn._pubTime+''+sours+''+zuozhe+'
    ');//图注装载}$("#Main-B").fadeIn("slow");loadingProcess.setPicHandler(n);},_creatUrl:function(n){//创建组图浏览url标识var _org = /\#p\=/i.test(window.location.href);if(!_org){window.location.href = window.location.href+"#p=1";}else{window.location.href = window.location.href.split("#p=")[0] + "#p="+parseInt(n+1);}},_getUrl:function(){//获得组图url标识var str = window.location.href.toString(),pos = str.indexOf("#p=");var nub = 1;if(pos!==-1){nub=str.match(/\#p\=(\d{1,})/i)[1];}return nub;},_Pload:function(data,n){//预加载前后if(data.length>3){//大于3张 才预加载if (n != Number(data.length - 1)) {this._preloadN.src = data[n + 1].bigpic}}},_showBig:function(data,n){//显示大图、显示成功后设置索引值对应的图注、url、组图当前索引值改写、小图位置、统计indexPic = n;$("#orgPic").attr("href",data[n].bigpic);//$("#PicSrc").attr("src","http://mat1.gtimg.com/www/hd2011/ajax-loader.gif");this._sharwb(data[n].bigpic);hdPic.fn._Pload(data,n);this._isAD && hdPic.fn._hideLast();var img = new Image();$("#PicSrc").load(function(){//hdPic.fn._autoSca($(this),data[n].bigpic);img.src = data[n].bigpic;hdPic.fn._replaceTitle();$(this).height()>600?$("#Main-A").height($(this).height()):$("#Main-A").height(600);$(this).css("margin-top",parseInt($("#Main-A").height()-$(this).height())/2+"px");}, function(){w = img.width, h = img.height;if(img.complete){if(w>980) w = 980;}img.onerror = function(){img = img.onload = img.onerror = null;};img.onload = function(){w = img.width;h = img.height;if(w>980) w = 980;img = img.onload = img.onerror = null;};$("#PicSrc").css('width', w);});$("#PicSrc").fadeTo("fast", 0, function(){hdPic.fn._showSmall(n);hdPic.fn._showtit(n);hdPic.fn._countPV(parseInt(n+1));//统计PGV$("#PicSrc").attr("src",data[n].bigpic);$("#PicSrc").fadeTo("fast",1);});hdPic.fn._pageNow = n;this._coupletAd(n,data);},/** 对联广告*/_coupletAd:function(n,data){var NoCouplet = "news,kid,finance,house,sh,cd,hb,hn,fj,henan,hd,gz,zz,zh,xm,wh,sz,cs,fz,zj";//无对联广告频道/** 广告对象* {"ch":域名,"ad":广告位id},全站通发为*,gaoqing_couplet*/var Channel = [{'ch':2012, 'ad':'Sports_AY_GQZT_Couplet'}, {'ch':'gd', 'ad':'gd_zutu_duilian_1201'}, {'ch':'cq', 'ad':'CQ12_GQZUTU_Duilian'}, {'ch':'xian', 'ad':'xian_zutu_gaoqing_ssdl'}];//频道自定义对联广告if(NoCouplet.indexOf(hdPic.fn._getDomain())==-1){//有广告频道var ADnb="gaoqing_couplet";//默认广告位$.each(Channel,function(i){if(this.ch==hdPic.fn._getDomain()){//自定义广告ADnb=this.ad;}});if(typeof crystal != 'undefined' && crystal.render) {crystal.render({"loc":ADnb,"curr":n,"total":data.length}); //xxx是广告位id,n是当前图片索引,data.length 为该组图图片总数}}},_autoSca:function($this,src){var img = new Image();img.src = src;if (img.width > 0 && img.height > 0) {//都大于0if(img.width>980) {$this.width(980);}}},

    PART--03

    $.ajax({url: "/c/otherPic.js",type: "GET",beforeSend: function(x) {x.setRequestHeader("If-Modified-Since","0");x.setRequestHeader("Charset", "GB2312");x.setRequestHeader("Cache-Control","no-cache");},success: function() {var arrMe = eval("(" + arguments[0] + ")")[0].root;for (i = 0; i 20){title = arrMe[i].article[1].title.substring(0,19)+"...";}tmp += '
  • ';}$("#lastComend").html(tmp);$("#lastComend div:eq(0)").css("float","left");$("#lastComend div:eq(2)").css("float","right");}});}else{$.ajax({url: "/c/otherPic.js",type: "GET",beforeSend: function(x) {x.setRequestHeader("If-Modified-Since","0");x.setRequestHeader("Charset", "GB2312");x.setRequestHeader("Cache-Control","no-cache");},success: function() {var arrMe = eval("(" + arguments[0] + ")")[0].root;for (i = 0; i 20){title = arrMe[i].article[1].title.substring(0,19)+"...";}tmp += '
  • ';}$("#lastComend").html(tmp);$("#lastComend div:eq(0)").css("float","left");$("#lastComend div:eq(2)").css("float","right");}});}},_clickleft:function(data){//向前点if(hdPic.fn._pageNow>0){hdPic.fn._pageNow--;hdPic.fn._showBig(data,hdPic.fn._pageNow);}else{hdPic.fn._pageNow = 0;return;}},_clickright:function(data){//向后点if(hdPic.fn._pageNow_this._listLen){$(".scrollButton").bind("selectstart",function(){return false;})$(".scrollButton").click(function(){}).mousedown(function(e){_this._isDoc = true;hdPic.fn._stopAuto();//设置捕获范围if($(".scrollButton").setCapture){$(".scrollButton").setCapture();}else if(window.captureEvents){window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);}hdPic.fn._isMove = true;hdPic.fn._dragx = e.pageX-parseInt($(".scrollButton").css("left"));$(".scrollButton").fadeTo(20, 0.5);$("a.mask").hide();});$(document).mousemove(function(e){if(hdPic.fn._isMove){var x=Math.max(0, Math.min(e.pageX-hdPic.fn._dragx,_this._listLen*110));$(".scrollButton").css({left:x});hdPic.fn._dragmov();}}).mouseup(function(){hdPic.fn._isMove=false;//取消捕获范围if($(".scrollButton").releaseCapture){$(".scrollButton").releaseCapture();}else if(window.captureEvents){window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);}$(".scrollButton").fadeTo("fast", 1);if(parseInt($("#Smailllist").css("left"))%131!==0 && _this._isDoc){var argleft = parseInt($("#Smailllist").css("left"));$("#Smailllist").animate({left:argleft+(Math.abs(parseInt($("#Smailllist").css("left"))%131))+"px"},"fast");};_this._isDoc = false;})};//自动播放$(".play").click(function(){if(!hdPic.fn._isAuto){hdPic.fn._autoplay(data);}else{hdPic.fn._stopAuto();}});//快捷键$(document).bind("keydown",function(e){e = window.event || e;hdPic.fn._stopAuto();e.keyCode == 37 && hdPic.fn._clickleft(data);e.keyCode == 39 && hdPic.fn._clickright(data);//e.keyCode == 38 && hdPic.fn._clickleft(data);//e.keyCode == 40 && hdPic.fn._clickright(data);});//焦点var scrollPos;if(typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {scrollPos = document.documentElement;}else if (typeof document.body != 'undefined') {scrollPos = document.body;}var _topnav = $("#toolBar").offset().top;$(scrollPos).animate({scrollTop:_topnav - 10}, 1000);},_stopAuto:function(){//停止自动播放$(".play").html("幻灯播放");$(".play").removeClass("stop");hdPic.fn._isAuto = false;window.clearInterval(hdPic.fn._autoTimer);},_autoplay:function(data){//自动播放$(".play").html("停止播放");$(".play").addClass("stop");hdPic.fn._isAuto = true;this._autoTimer = window.setInterval(function(){if(hdPic.fn._pageNow"+hdPic.fn._sourName+"":""+hdPic.fn._sourName+"";var zuozhe = hdPic.fn._auth!==""?""+hdPic.fn._auth+"":"";if(this._tmpArray[n].showtit==""){$("#Main-B").html('
    '+hdPic.fn._pubTime+''+sours+''+zuozhe+'
    ');//图注装载}else{$("#Main-B").html('

    '+this._tmpArray[n].showtit+'

    '+hdPic.fn._pubTime+''+sours+''+zuozhe+'
    ');//图注装载}$("#Main-B").fadeIn("slow");loadingProcess.setPicHandler(n);},_creatUrl:function(n){//创建组图浏览url标识var _org = /\#p\=/i.test(window.location.href);if(!_org){window.location.href = window.location.href+"#p=1";}else{window.location.href = window.location.href.split("#p=")[0] + "#p="+parseInt(n+1);}},_getUrl:function(){//获得组图url标识var str = window.location.href.toString(),pos = str.indexOf("#p=");var nub = 1;if(pos!==-1){nub=str.match(/\#p\=(\d{1,})/i)[1];}return nub;},_Pload:function(data,n){//预加载前后if(data.length>3){//大于3张 才预加载if (n != Number(data.length - 1)) {this._preloadN.src = data[n + 1].bigpic}}},_showBig:function(data,n){//显示大图、显示成功后设置索引值对应的图注、url、组图当前索引值改写、小图位置、统计indexPic = n;$("#orgPic").attr("href",data[n].bigpic);//$("#PicSrc").attr("src","http://mat1.gtimg.com/www/hd2011/ajax-loader.gif");this._sharwb(data[n].bigpic);hdPic.fn._Pload(data,n);this._isAD && hdPic.fn._hideLast();var img = new Image();$("#PicSrc").load(function(){//hdPic.fn._autoSca($(this),data[n].bigpic);img.src = data[n].bigpic;hdPic.fn._replaceTitle();$(this).height()>600?$("#Main-A").height($(this).height()):$("#Main-A").height(600);$(this).css("margin-top",parseInt($("#Main-A").height()-$(this).height())/2+"px");}, function(){w = img.width, h = img.height;if(img.complete){if(w>980) w = 980;}img.onerror = function(){img = img.onload = img.onerror = null;};img.onload = function(){w = img.width;h = img.height;if(w>980) w = 980;img = img.onload = img.onerror = null;};$("#PicSrc").css('width', w);});$("#PicSrc").fadeTo("fast", 0, function(){hdPic.fn._showSmall(n);hdPic.fn._showtit(n);hdPic.fn._countPV(parseInt(n+1));//统计PGV$("#PicSrc").attr("src",data[n].bigpic);$("#PicSrc").fadeTo("fast",1);});hdPic.fn._pageNow = n;this._coupletAd(n,data);},/** 对联广告*/_coupletAd:function(n,data){var NoCouplet = "news,kid,finance,house,sh,cd,hb,hn,fj,henan,hd,gz,zz,zh,xm,wh,sz,cs,fz,zj";//无对联广告频道/** 广告对象* {"ch":域名,"ad":广告位id},全站通发为*,gaoqing_couplet*/var Channel = [{'ch':2012, 'ad':'Sports_AY_GQZT_Couplet'}, {'ch':'gd', 'ad':'gd_zutu_duilian_1201'}, {'ch':'cq', 'ad':'CQ12_GQZUTU_Duilian'}, {'ch':'xian', 'ad':'xian_zutu_gaoqing_ssdl'}];//频道自定义对联广告if(NoCouplet.indexOf(hdPic.fn._getDomain())==-1){//有广告频道var ADnb="gaoqing_couplet";//默认广告位$.each(Channel,function(i){if(this.ch==hdPic.fn._getDomain()){//自定义广告ADnb=this.ad;}});if(typeof crystal != 'undefined' && crystal.render) {crystal.render({"loc":ADnb,"curr":n,"total":data.length}); //xxx是广告位id,n是当前图片索引,data.length 为该组图图片总数}}},_autoSca:function($this,src){var img = new Image();img.src = src;if (img.width > 0 && img.height > 0) {//都大于0if(img.width>980) {$this.width(980);}}}, 你这JS代码在哪里弄的?复制放在DW中均提示语法错误啊。。

    part--004

    _showSmall:function(n){//小图移动切换逻辑var _this = this, _len = hdPic.fn._tmpArray.length$("a.mask").show();if(_len =_n && n<_len-_n> 1) {$("#Smailllist").css({left: -131*(n-_n)+"px"});}else{$("#Smailllist").stop(true, true).animate({left:-131*(n-_n)+"px"},"slow");}}, 200);if(!this._record){_left = (131*_n)+4+"px";$("a.mask").animate({left:_left},"fast");$(".scrollButton").animate({left:_left},"fast");this._record = true;}}else{this._record = false;if(n>=_len-_n){_left = (131*(_latsindex-(_len-n)))+4+"px";$("#Smailllist").animate({left:-(_len-this._listLen)*131+"px"},"slow");$("a.mask").animate({left:_left},"slow");$(".scrollButton").animate({left:_left},"fast");}else{if(n");},_countPV:function(index){//刷新PVthis._coreload("http://pingjs.qq.com/ping.js",function(){try{if (typeof pgvMain == "function") {if(pvRepeatCount==2){pvRefDomain=window.location.host;pvRefUrl=location.pathname;}pvRepeatCount =1;pgvMain();}}catch(e){}hdPic.fn._creatUrl(parseInt(index-1));});},_getData:function(data,coent){//第一次加载后,初始化大图、小图、绑定事件、统计等if(coent!==""){$("#Main-D").html(coent);}if(data.length>0){/*成功*/$("#Main-A").append("");this._getReady();//大图readythis._small(data);//装载小图this._pageNow = parseInt(hdPic.fn._getUrl()-1);this._bindClick(data);$("#orgPic").attr("href",data[parseInt(hdPic.fn._getUrl()-1)].bigpic);this._showBig(data,parseInt(hdPic.fn._getUrl()-1));//setPicHandler}},_falshInt:function(data){loadingProcess.initSystems();//初始化全屏按钮loadingProcess.isJsReady = true;loadingProcess.setFullScreenDatas(data);//全屏数据传递},_getDomain:function(){//返回域名var Do = window.location.hostname;return Do.split(".")[0];},_small:function(data){//第一次加载后初始化小图var _tmp="",ulLength=131*data.length;$.each(data,function(i){if(i==0){_tmp+='
  • '+(i+1)+"/"+data.length+'
  • ';}else{_tmp+='
  • '+(i+1)+"/"+data.length+'
  • ';}});$("#Smailllist").width(ulLength);$("#Smailllist").html(_tmp);/*放大镜*/if(hdPic.fn._getDomain()=="ent" || hdPic.fn._getDomain()=="lady"){//女性、娱乐灰度var _width=0,_height=0;$("#Smailllist img").each(function(){$(this).bind('mouseover',function(e){var _selfs = $(this);$(".sh").html('腾讯的这个JS幻灯太难扣了,求高人指点。。。_html/css_WEB-ITnose');$("#preloadBig").load(function(){$(".sh").css({'left':_selfs.offset().left-parseInt(130-61)+'px','top':parseInt(_selfs.offset().top-270)+'px'});_width = $(this).width();_height=$(this).height();$("#preloadBig").css({'left':'0px','top':'0px'});$(".sh").fadeIn('slow');});});$(this).bind('mousemove',function(e){e = e || window.event;var x=e.clientX,y=e.clientY,ori=this.getBoundingClientRect(),z=Math.round($(".sh").width()/2);var zoom = $("#preloadBig").width()/$(this).width();x-=ori.left;y-=ori.top;$("#preloadBig").css({'left':-parseInt(x*zoom)+'px','top':-parseInt(y*zoom)+'px'});});$("#Smailllist").bind('mouseout',function(){$(".sh").fadeOut('slow');})})}/*放大镜*/},/*@个性配置*/_specific:function(){if(this._specificID!==""){if(this._specificID.indexOf("|")!==-1){var DOms = this._specificID.split("|");$.each(DOms,function(){try{$(this).hide();}catch(e){}})}else{try{$(this._specificID).css("visibility","hidden");}catch(e){}}}},_query:function(){//第一次加载,使用ajax加载数据,并在成功后把数据格式化到本地var org = window.location.href;$.ajax({url: org.split(".htm")[0]+".hdBigPic.js?time="+Math.random(),/* url:"http://ent.qq.com/a/20110816/000246.hdBigPic.js",*/type: "GET",beforeSend: function(x) {x.setRequestHeader("If-Modified-Since","0");x.setRequestHeader("Charset", "GB2312");x.setRequestHeader("Cache-Control","no-cache");},success: function() { //ajax成功var arrMe = eval("(" + arguments[0] + ")");var length = arrMe.Children[0].Children[0].Children[0].Content;//长度for(var i=0;i/i,"").replace(/\/i,"")+'', 'showtxt':''+arrMe.Children[0].Children[1].Children[i].Children[0].Children[0].Content+'', 'smallpic':''+arrMe.Children[0].Children[1].Children[i].Children[1].Children[0].Content+'', 'bigpic':''+arrMe.Children[0].Children[1].Children[i].Children[2].Children[0].Content+''})}hdPic.fn._isgoOn = arrMe.Children[0].Children[5].Children[0].Content==0?false:true;//是否连续播放下一组图hdPic.fn._lastTitle = arrMe.Children[0].Children[3].Children[0].Content;//下一篇组图标题hdPic.fn._lastUrl = arrMe.Children[0].Children[2].Children[0].Content;//下一篇组图地址if(arrMe.Children[0].Children[8].Children.length!==0){hdPic.fn._coentArray = arrMe.Children[0].Children[8].Children[0].Content;//底部文章区$("#Main-D").show();}else{hdPic.fn._coentArray = "";$("#Main-D").hide();}/*尼尔森统计结束*//*hdPic.fn._countIFrame();//创建统计iframe;*/hdPic.fn._getData(hdPic.fn._tmpArray,hdPic.fn._coentArray);hdPic.fn._falshInt(hdPic.fn._tmpArray);if(hdPic.fn._isCiment=="2"){hdPic.fn._iwannComent(hdPic.fn._siteEname,hdPic.fn._aid);}else{$("#toolBar").find("ul.right").hide();};hdPic.fn._specific();},error: function(x, e) {$("#Main-P-QQ").html("
    数据加载错误!
    ");},complete: function(x) {}});},showBottomAD : function(){if(this.nowSite() == 'news' ){if(hdPic.fn._isShowLastAD && hdPic.fn._isShowLastAD == 1){$('#adBottom') && $('#adBottom').show();}}},init:function(p){window.onerror = ResumeError;hdPic.fn._sourName = p.name;//来源;hdPic.fn._sourUrl = p.url;//来源Url;hdPic.fn._pubTime = p.time;//发布时间;hdPic.fn._siteName = p.siteName;//站点中文名hdPic.fn._siteLink = p.siteLink;//站点链接hdPic.fn._isPic =p.ispic;//是否图片站hdPic.fn._isCiment = p.isComent;//是否评论hdPic.fn._aid = p.aid;//文章IDhdPic.fn._siteEname = p.siteEname;//站点英文名hdPic.fn._isShowLastAD = p.isShowLastAD;//是否显示末页广告 1 : 显示 0 : 隐藏if(typeof hdpic_specifics!=="undefined"){hdPic.fn._specificID =hdpic_specifics;//个性配置隐藏区域}if(typeof p.auth!=="undefined"){hdPic.fn._auth = p.auth;//作者}this._coreload(this._coreurl,function(){$(document).ready(function($){hdPic.fn._query();hdPic.fn._createAD();hdPic.fn._buttonAD();hdPic.fn._insetAD();hdPic.fn.showBottomAD();crystal.request();});});}}hdPic.fn.init.prototype = hdPic.fn;function _cbSum(){$("#iwannComent").html("我要评论("+arguments[0]+")");hdPic.fn._siteEname.replace('_', '');var site = /house/g.test(hdPic.fn._siteEname) ? 'house' : hdPic.fn._siteEname;$("#iwannComent").attr("href","http://comment5." + site + ".qq.com/comment.htm?site=" + site + "&id="+hdPic.fn._aid);};

    因为文件代码太多,无法一次放上来,四个部分加起来才是一个完整的JS文件

    因为文件代码太多,无法一次放上来,四个部分加起来才是一个完整的JS文件
    这么牛,怎么扣下来的。。。

    用 firebug 可以清楚的看到HTML的 JS 和 DOM

    用 firebug 可以清楚的看到HTML的 JS 和 DOM
    我看,很多不都是加密过的吗?

    也有没加密的啊,刚好LZ想要的那个部分没加密

    用 firebug 可以清楚的看到HTML的 JS 和 DOM
    我把这三段JS放到HTML代码里面还是不行,用外部导入的方式也不行啊。。还是没作用。。。。这是为什么??


    用 firebug 可以清楚的看到HTML的 JS 和 DOM
    我看,很多不都是加密过的吗?

    你的级别很高啊,你也搞不定啊。呵呵

    也有没加密的啊,刚好LZ想要的那个部分没加密

    我现在把那三段JS代码加进去了不是不行,要不你在你本机试试,扣好了发我看看,谢了。我的邮件:gpedit_andy@qq.com


    用 firebug 可以清楚的看到HTML的 JS 和 DOM
    我把这三段JS放到HTML代码里面还是不行,用外部导入的方式也不行啊。。还是没作用。。。。这是为什么??
    4个部分加起来才是完整的JS代码。
    不过LZ等你搞清楚怎么用所耗的时间 可能比 你自己开发的时间还要长吧。

    也有没加密的啊,刚好LZ想要的那个部分没加密
    晕,没看,我以为,那些网站的都加密了呢……
    原来也有没加密的。
    还有,那么一堆js,拿过来,调,一个报错,LZ够呛的。。。


    也有没加密的啊,刚好LZ想要的那个部分没加密

    我现在把那三段JS代码加进去了不是不行,要不你在你本机试试,扣好了发我看看,谢了。我的邮件:gpedit_andy@qq.com
    LZ,你这也有点太过分了吧,人家都给你找好了,你还要别人给你调好呀。。。



    也有没加密的啊,刚好LZ想要的那个部分没加密

    我现在把那三段JS代码加进去了不是不行,要不你在你本机试试,扣好了发我看看,谢了。我的邮件:gpedit_andy@qq.com
    LZ,你这也有点太过分了吧,人家都给你找好了,你还要别人给你调好呀。。。

    同意,人不能太贪婪... ...
    最终还得靠自己的 ... ...




    也有没加密的啊,刚好LZ想要的那个部分没加密

    我现在把那三段JS代码加进去了不是不行,要不你在你本机试试,扣好了发我看看,谢了。我的邮件:gpedit_andy@qq.com
    LZ,你这也有点太过分了吧,人家都给你找好了,你还要别人给你调好呀。。。

    同意,人不能太贪婪... ...
    最终还得靠自己的 ... ...


    哈哈。。好的,我在这里多谢大家了,不行了就换别的吧。。。

    又见伸手党,fuck

    强烈建议用HTML5来实现幻灯片效果