Because the whole project is not written by themselves, but to help others to write JS roller code, and other projects are still not on-line, so just post their own part of the code,
Effect: When the mouse wheel scrolls, the screen of one screen and one screen up and down switch
(The following code in the local computer's ie,chrome and Firefox these three browsers have been tested and have been successful)
var sum=0; var Otxt=document.getelementbyid ("txt"); var scrollfunc=function (e) {var direct=0; var men = $ (". Menu_m"). Find (". Menu"). Find ("Li"); Men.each (function (j) {if ($ (this). attr ("class") = = "M_selected") {sum=j; } }); e=e | | window.event; if (E.wheeldelta) {//ie/opera/chrome if (navigator.appname== ' Netscape ') {//Chorme roll once with two effects, so add 0.5 if (e.wheeldelta>0) {sum=parsefloat (sum-0.5); } else{sum=parsefloat (sum) +0.5; }}else{if (e.wheeldelta>0) sum=parsefloat (sum-1); else Sum=parsefloat (sum+1); }else if (e.detail) {//firefox//firefox up-down values are not the same as above, you can print out to see if (e.detail>0) sum=parsefloat (sum+ 1); else Sum=parsefloat (sum-1); }//sum out of the, here is what you want to do, I am here to write with the current project has so associated with the screen jump, but rememberTo add a return false; Otherwise, in Google and IE, will appear, rolled more than the Var sizes= $ (". Menu_m"). Find (". Menu"). Find ("Li"). Size (); if (sum>=0&&parsefloat (sum) <=parsefloat (sizes)-1) {Men.each (function (j) {$ (this). Removeclass ("m_selected")}); $ (". Menu_m"). Find (". Menu Li:eq (" +sum+ ")"). Find ("span"). Click (); return false; }}/* Register Event */if (document.addeventlistener) {document.addeventlistener (' dommousescroll ', Scrollfunc,false);} W3cwindow.onmousewheel=document.onmousewheel=scrollfunc;//ie/opera/chrome/safari
JS Roll Rotation Cutting screen