首页 > Web开发 > 详细

jQuery扩展

时间:2015-10-12 18:49:47      阅读:282      评论:0      收藏:0      [点我收藏+]

有时候需要在jQuery基础上做属于自己的功能

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="js/jquery.min.js"></script>
    <script src="js/myquery.js"></script>
    <script src="js/demo.js"></script>
</head>
<body>
    <div></div>
</body>
</html>
myquery.js 扩展文件
// $.myjq=function(){
//     alert("myjQuery");
// }
$.fn.myjq=function(){
    $(this).text("hello");
}

demo.js 

$(document).ready(function(){
    //$.myjq();
    $("div").myjq();
})

 

jQuery扩展

原文:http://www.cnblogs.com/tinyphp/p/4872323.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!