摘要: 所以在css中当使用内联css时,相对地址为图像相对于htm文件的地址;当使用外联css时,相对地址应为图像相对于css文件的地址! eg: index.htmlimages/n.pngstyle/css.css当使用内联方式时,用background-image设置index.htm中的对象的背景 阅读全文
posted @ 2017-06-28 21:54 小_Li_Kelly_前端 阅读(11692) 评论(0) 推荐(0) 编辑
摘要: 1:之前做的是两套页面。现在改成响应式布局。发现加上 @media only screen and (max-width: 500px) { .gridmenu { width:100%; } .gridmain { width:100%; } .gridright { width:100%; }} 阅读全文
posted @ 2017-06-27 15:54 小_Li_Kelly_前端 阅读(8863) 评论(0) 推荐(1) 编辑
摘要: 1:动态添加 对象属性 var obj = new Object(); console.log (obj.username); obj.username = "haha"; console.log (obj.username); //undefined //haha 用“[]”表示。写成 obj[" 阅读全文
posted @ 2017-06-24 22:25 小_Li_Kelly_前端 阅读(34261) 评论(0) 推荐(1) 编辑
摘要: 提供一种方法就是利用jquery.form.js。 (1)这个框架集合form提交、验证、上传的功能。 核心方法 -- ajaxForm() 和 ajaxSubmit() $('#myForm').ajaxForm(function() { alert("提交成功!欢迎下次再来!"); }); $( 阅读全文
posted @ 2017-06-23 22:04 小_Li_Kelly_前端 阅读(11295) 评论(0) 推荐(0) 编辑
摘要: $(function() { //控制一行半隐藏 (function ($) { $.fn.displayPart = function (opts) { $(this).each(function () { displayPart($(this), opts); }); } function di 阅读全文
posted @ 2017-06-20 22:38 小_Li_Kelly_前端 阅读(801) 评论(0) 推荐(0) 编辑
摘要: 1:常见的三种绑定click事件: 第一种:$("#click").click(function(){ alert("Hello World click"); }); 第二种:$('#clickon').on('click', function(){ alert("Hello World on"); 阅读全文
posted @ 2017-06-12 17:46 小_Li_Kelly_前端 阅读(19809) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-06-12 13:58 小_Li_Kelly_前端 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Jquery中$(document).ready()的作用类似于传统JavaScript中的window.onload方法,不过与window.onload方法还是有区别的。 1.执行时间 window.onload必须等到页面内包括图片的所有元素加载完毕后才能执行。 $(document).rea 阅读全文
posted @ 2017-06-12 12:19 小_Li_Kelly_前端 阅读(950) 评论(0) 推荐(0) 编辑
摘要: 对于HTML元素本身就带有的固有属性,在处理时,使用prop方法比如href,class等。 对于HTML元素我们自己自定义的DOM属性,在处理时,使用attr方法,比如自定义的data-id属性。使用prop方法取值和设置属性值时,都会返回undefined值。 对于checkbox,radio和 阅读全文
posted @ 2017-06-12 11:52 小_Li_Kelly_前端 阅读(154) 评论(0) 推荐(0) 编辑