雪茄天书网页图像来源于网络仅供学习参考,如有需要请购买正版图书
')
var index=1;
$(".prev").on("click",function(){
if(index == 1){alert("已经到第一张了!");return false;}
scrollFun(--index)
});
$(".next").on("click",function(){
if(index == "464"){alert("已经到最后一张了!");return false;}
scrollFun(++index);
});
function scrollFun(x){
$("#showImg").attr("src","");
$("#showImg").attr("src","images/hw ("+x+").jpg");
}
$(".bigImg").click(function(){
if($(this).hasClass("on")){
$(this).removeClass("on")
$(this).attr("title","点击缩小");
$(this).animate({"width":"50%"});
}else{
$(this).addClass("on")
$(this).attr("title","点击放大");
$(this).animate({"width":"35%"});
}
})
$(".muList a").on("click",function(){
index = $(this).attr("data-id");
scrollFun(index);
});
function adsFun(param){
var u=window.location.toString(),
r=new RegExp("\\?(?:.+&)?" + param + "=(.*?)(?:&.*)?$");
if(param=="usurl"){
return u.substring(u.indexOf("usurl=")+6);
}
var m = u.match(r);
return m ? decodeURIComponent(m[1]) : "";
}
var pageId = adsFun("id");
if(pageId){
index = pageId;
scrollFun(index);
}
});
document.body.onselectstart = document.body.ondrag = function(){
return false;
}