摘要: 方法一:前台页面js代码:$.getJSON('http://www.h5clubs.com/rec.php?c=abc&callback=?', jsondata, function (data) { console.log(data); ... 阅读全文
posted @ 2015-06-10 14:44 雷林007 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 1.jquery ajax自己常用写法如下:$.post(url,data,function(data){ //data为返回的数据});$.post写法1 $.get(url,data,function(data){2 //与post相同,只是传输方式不同3 });$.get写法 1... 阅读全文
posted @ 2015-05-22 17:51 雷林007 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 引入顺序:function() 1 $.fn.consFont = function (speed,split,startTime){ 2 if(!startTime) startTime = 0; 3 var count = 0; 4 var timer; 5 ... 阅读全文
posted @ 2015-05-22 15:44 雷林007 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1 $('li').click(function(){ 2 $(this).css({ 3 'background-color': function(){ 4 return 'red'; 5 }, 6 'height... 阅读全文
posted @ 2015-05-22 11:04 雷林007 阅读(262) 评论(0) 推荐(0) 编辑
摘要: :header是为了 匹配 h1,h2,h3等元素的。$(':header').css('color','red'); 阅读全文
posted @ 2015-05-21 18:13 雷林007 阅读(126) 评论(0) 推荐(0) 编辑
摘要: $(window).scroll(function(){ //var top = $(this).scrollTop(); //这里用top值来判断与window顶部的距离,用来实现加载到某一固定的位置来显示某一元素的方法}); 阅读全文
posted @ 2015-05-21 17:40 雷林007 阅读(115) 评论(0) 推荐(0) 编辑
摘要: error可以在 元素加载错误的时候调用如 在页面加载的时候 出现错误,就可以用如下方法:$(window).error(function(){//alert('error');});像其它元素也是可以这样用的,还比如说 img元素,当img加载出错的时候 ,也可以这样写$('img').error... 阅读全文
posted @ 2015-05-21 16:01 雷林007 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 1.text2.textarea3.select只有在值改变之后,失去焦点之后才会触发 change(); 阅读全文
posted @ 2015-05-21 15:31 雷林007 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 以下是几种绑定方式:1.普通的,只为一个元素绑定click事件$('.abc').on('click' ,function(){ alert('click event'); })2.在这里 可以改进一下第一种方法,将function()单写出来 (方法一的改进版本)$('.abc').on... 阅读全文
posted @ 2015-05-21 14:41 雷林007 阅读(137) 评论(0) 推荐(0) 编辑
摘要: html布局如下: 1 2 3 aside 4 5 6 a 7 a 8 a 9 a10 a11 a12 a13 a14 a15 16 css 代码: 1 .first{ 2 positio... 阅读全文
posted @ 2015-05-20 16:06 雷林007 阅读(587) 评论(0) 推荐(0) 编辑