<div class="codetitle"> <span><a style="CURSOR: pointer" data="23522" class="copybut" id="copybut23522" onclick="doCopy('code23522')"><u>复代码码</u></a></span> 代码如下:</div> <div class="codebody" id="code23522"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 전환//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <br><머리> <br><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <br><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <br><제목></제목> <br></head> <br><본문> <br><input type="button" value="test" id="test"/> <br><script type="text/javascript"> <br>$(function(){ <br>$("#test").hello({ <br>"size":1 <br>}); <br>}); <br></script> <br><script type="text/javascript"> <br>;(함수($){ <br>$.fn.hello = 함수(옵션){ <br>var defaults = {"size":0}, <br><br>opts = $.extend( {},기본값,옵션), <br><br>show = { <br>play:function(options){ <br>var _root = this <br>_root.autoPlay(); (); <br>}, <br>autoPlay:function(){ <br>console.log("auto") <br>}, <br>eventClick:function(){ <br>//$( "#test").on("click",{show:"dd"},function(e){ <br>// console.log("click:" e.data.show); <br>// }); <br><br>$("#test").on({ <br>click:function(){ <br>alert("click"); <br>}, <br>mouseenter:function (){ <br>alert("enter"); <br>}, <br>mouseleave:function(){ <br>alert("leave") <br>} <br>}); } <br>}; <br>return this.each(function(){ <br>show.play(opts); <br>}) <br>})(jQuery); <br></script> <br></body> <br></html> <br><br> </div>