[JavaScript]火狐下鼠標滾輪事??/a> [JavaScript]

來源:本網整理

火狐下需要…怎么說呢(我就暫且說成是顯式獲取對象吧):marquePic2.innerHTML=marquePic1.innerHTML改成:document.getElementById("marquePic2").innerHTML=document.getElementById("marquePic1").innerHTML;應該就可以了!var speed=30document.getElementById("marquePic2").innerHTML=document.getElementById("marquePic1").innerHTMLfunction Marquee(){if(document.getElementById("demo").scrollLeft>document.getElementById("marquePic1").scrollWidth){document.getElementById("demo").scrollLeft=0}else{document.getElementById("demo").scrollLeft+}}var MyMar=setInterval(Marquee,speed)demo.onmouseover=function(){clearInterval(MyMar)}demo.onmouseout=function(){MyMar=setInterval(Marquee,speed)}出于兼容考慮,建議獲取對象統統都用document.getElementById("")來獲取。這個代碼沒錯的,我測試過了!demo is not defined是獲取節點的錯誤!應該是你沒有統統都用document.getElementById("")來獲取節點對象造成的。這里有三個要獲取的節點對象:document.getElementById("demo")document.getElementById("marquePic1")document.getElementById("marquePic2")www.anxorj.tw防采集請勿采集本網。

鼠標滾輪事件在火狐下的兼容問??div class='clear'> scrolltotop.offset(100,120); scrolltotop.init();

[1].[代碼] [JavaScript]代碼 跳至[1]

//兼容火狐的鼠標滾輪事?? document.getElementById("t1").addEventListener("DOMMouseScroll",function(e){ scrollFunc(e,$(".table_1"),$("#pageNum"),$("#total")); },false); document.getElementById("t2").addEventListener("DOMMouseScroll",function(e){ scrollFunc(e,$(".table_2"),$("#pageNum_phone"),$("#total_phone")); },false); document.getElementById("t3").addEventListener("DOMMouseScroll",function(e){ scrollFunc(e,$(".table_3"),$("#pageNum_bus"),$("#total_bus")); },false); //chroom和ie下的鼠標滾輪事件 $('.table_1 table').on("mousewheel", function() { scrollFunc(e,$(this),$("#pageNum"),$("#total")); }); $('.table_2 table').on("mousewheel",function(){ scrollFunc(e,$(this),$("#pageNum_phone"),$("#total_phone")); }) $('.table_3 table').on("mousewheel",function(){ scrollFunc(e,$(this),$("#pageNum_bus"),$("#total_bus")); })}function scrollFunc(e,that,pageNum,totalPage){ var e = e || window.event; if (e.wheelDelta) { if (e.wheelDelta > 0) { up(that,pageNum,totalPage);//chroom和ie下,鼠標滾輪向上?? } if (e.wheelDelta < 0) { down(that,pageNum,totalPage);//chroom和ie下,鼠標滾輪向下?? } } else if (e.detail) { if (e.detail> 0) { down(that,pageNum,totalPage);//火狐下,鼠標滾輪向下??與chroom和ie方向相反) } if (e.detail< 0) { up(that,pageNum,totalPage);//火狐,鼠標滾輪向上滾(與chroom和ie方向相反) } }} SyntaxHighlighter.autoloader( 'applescript/js/sh309/scripts/shBrushAppleScript.js?t=1451961936000', 'actionscript3 as3/js/sh309/scripts/shBrushAS3.js?t=1451961936000', 'bash shell/js/sh309/scripts/shBrushBash.js?t=1451961936000', 'coldfusion cf/js/sh309/scripts/shBrushColdFusion.js?t=1451961936000', 'cpp c/js/sh309/scripts/shBrushCpp.js?t=1451961936000', 'obj-c objc/js/sh309/scripts/shBrushObjC.js?t=1451961936000', 'c# c-sharp csharp/js/sh309/scripts/shBrushCSharp.js?t=1451961936000', 'css/js/sh309/scripts/shBrushCss.js?t=1451961936000', 'delphi pascal/js/sh309/scripts/shBrushDelphi.js?t=1451961936000', 'diff patch pas/js/sh309/scripts/shBrushDiff.js?t=1451961936000', 'erl erlang/js/sh309/scripts/shBrushErlang.js?t=1451961936000', 'groovy/js/sh309/scripts/shBrushGroovy.js?t=1451961936000', 'haxe hx/js/sh309/scripts/shBrushHaxe.js?t=1451961936000', 'java/js/sh309/scripts/shBrushJava.js?t=1451961936000', 'jfx javafx/js/sh309/scripts/shBrushJavaFX.js?t=1451961936000', 'js jscript javascript/js/sh309/scripts/shBrushJScript.js?t=1451961936000', 'perl pl/js/sh309/scripts/shBrushPerl.js?t=1451961936000', 'php/js/sh309/scripts/shBrushPhp.js?t=1451961936000', 'text plain/js/sh309/scripts/shBrushPlain.js?t=1451961936000', 'py python/js/sh309/scripts/shBrushPython.js?t=1451961936000', 'ruby rails ror rb/js/sh309/scripts/shBrushRuby.js?t=1451961936000', 'scala/js/sh309/scripts/shBrushScala.js?t=1451961936000', 'sql/js/sh309/scripts/shBrushSql.js?t=1451961936000', 'vb vbnet/js/sh309/scripts/shBrushVb.js?t=1451961936000', 'xml xhtml xslt html/js/sh309/scripts/shBrushXml.js?t=1451961936000' ); SyntaxHighlighter.all();

您好,感謝您對火狐的支持 這個無法實現,火狐瀏覽器因為安全限制原因,禁止獲得剪切板的內容。您可以在火狐官方網站下載火狐瀏覽器,在火狐社區了解更多內容。希望我的回答對您有所幫助,如有疑問,歡迎

一般都這樣子用的(1)">aaaaaaa</a>-(0)">bbbbbbfunction text(action){var conert=document.getElementById("1");var conert1=document.getElementById("2");if(action=1){conert.style.display="none;conert1.style.display="block;}else{conert.style.display="block;conert1.style.display="none;}}height:20px;display:block">aaaaaaaaaaaaaaaheight:20px;display:none">bbbbbbbbbbbbbbb</div>內容來自www.anxorj.tw請勿采集。

免責聲明 - 關于我們 - 聯系我們 - 廣告聯系 - 友情鏈接 - 幫助中心 - 頻道導航
Copyright © 2017 www.anxorj.tw All Rights Reserved
陕西快乐10分下载