Home > Web Front-end > HTML Tutorial > Questions about addEventListener_html/css_WEB-ITnose

Questions about addEventListener_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:17:20
Original
1515 people have browsed it

Helping others debug a piece of code. After debugging for a while, I found that there are many problems and my head is spinning. Please help me.

<!DOCTYPE html><html><head><SCRIPT TYPE="text/javascript" SRC="jquery.js"></SCRIPT></head><body><a href="" title="">Long press</a><p>长时间点击2秒后我会变颜色</p><script type=text/javascript>   function down(){    var timeout = window.setTimeout(function() {$("p").css("color","yellow");},1000);});function up(){    $("p").css("color","black");});$("a").addEventListener("mousedown",down,false); $("a").addEventListener("mouseup",up,false); </script> </body></html>
Copy after login


Reply to the discussion (solution)




Untitled Document

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template