随笔分类 -  JQuery

摘要:jQuery控制位置、滚条操作 jQuery获取块级元素的宽高 $('div').width() $('div').innerWidth() //padding + width $('div').outerWidth() //padding + width + border $('div').out 阅读全文
posted @ 2017-09-06 10:42 MrPat 阅读(243) 评论(0) 推荐(0)
摘要:jQuery自定义插件 jQuery.prototype.sayHello = function(){ console.log("hello"); } $(document).sayHello(); //相当于 $.fn.sayHello = function(){ console.log("hel 阅读全文
posted @ 2017-09-06 09:39 MrPat 阅读(105) 评论(0) 推荐(0)
摘要:jQuery基础入门学习 入口函数 JavaScript的入口函数 window.onload=function(){ console.log('这是Javascript的入口函数!'); }; jQuery的两种入口函数 $(document).ready(function(){ console. 阅读全文
posted @ 2017-09-06 09:36 MrPat 阅读(250) 评论(0) 推荐(0)
摘要:jQuery事件机制 事件的注册 普通的注册简单的事件,缺点只能注册一个事件 $("p").click(function(){ alert("简单的事件"); }) bind方式注册事件 $("p").bind({ click:function(){ alert('这是bind的click事件'); 阅读全文
posted @ 2017-08-30 22:27 MrPat 阅读(353) 评论(0) 推荐(1)