//本网站效果由昆明天度网络iris原创制作 function screenboxshow(outid,sumid,liid){ var _out = $(outid); var _sum = _out.find(sumid); var _liarr = _sum.find(liid); var _length = _liarr.length; var _index = 0; var _width= $(window).width(); var _height = $(window).height(); var _bool = true; var _nav = $(".navbox"); var _float = $(".floatbox p"); //必要样式添加 _out.css({ "position":"relative", "width":"100%", "overflow":"hidden", "height":_height+"px" }); _sum.css({ "position":"relative", "width":"100%", "left":"0px", "top":"0px" }); _liarr.css({ "position":"relative", "width":"100%", "overflow":"hidden", "height":_height+"px", "display":"block" }) //屏幕变化and必要初始值 var winsize = function(){ _width= $(window).width(); _height = $(window).height(); _out.css({"height":_height+"px"}); _liarr.css({"height":_height+"px"}); var _nowmove = -_index * _height; _sum.css({"top":_nowmove+"px"}); if(_index == 0){ _nav.css({"top":"120px"}); }else{ _nav.css({"top":"0px"}); } _float.eq(_index).addclass("sel").siblings().removeclass("sel"); if(_width <= 1366){ $(".floatbox").css("display","none"); }else{ $(".floatbox").css("display","block"); } }; winsize(); $(window).resize(function(){ winsize(); }); //主体运动 var screencartoon = function(){ var _nowmove = -_index * _height; if(_sum.is(":animated")){_sum.stop(true,true);} _sum.animate({top:_nowmove+"px"},300,function(){ _bool = true; }); if(_index == 0){ _nav.animate({top:"120px"},300); }else{ _nav.animate({top:"0px"},300); } _float.eq(_index).addclass("sel").siblings().removeclass("sel"); }; _float.click(function(){ _index = $(this).index(); screencartoon(); }); $(".indexnext").click(function(){ nextpage(); }); var nextpage = function(){ _index++; if(_index >= _length){ _index = _length-1; } screencartoon(); } var lastpage = function(){ _index--; if(_index < 0){ _index = 0; } screencartoon(); } $('body').bind('mousewheel',function(event, delta){ if(_bool){ _bool = false; if(delta < 0){nextpage();}else {lastpage();} } //bool end });//滚轮判断 }//fun end //禁止滚轮影响滚动条 function disabledmousewheel() { if (document.addeventlistener) { document.addeventlistener('dommousescroll', scrollfunc, false); } window.onmousewheel = document.onmousewheel = scrollfunc; } function scrollfunc(evt) { evt = evt || window.event; if (evt.preventdefault) { evt.preventdefault(); evt.stoppropagation(); } else { evt.cancelbubble = true; evt.returnvalue = false; } return false; } window.onload=disabledmousewheel;