摘要: jQuery拥有可操作HTML元素和属性的方法。获得内容:text()--设置或返回所选元素的文本内容html()--设置或返回所选元素的内容(包括HTML标记)val()--设置或返回表单字段的值获取属性:attr()方法用于获取属性值例如:1 $("button").click(function... 阅读全文
posted @ 2014-11-14 15:29 G-Beniot 阅读(220) 评论(0) 推荐(0)
摘要: $(this).hide()-----隐藏当前元素$("p").hide()------隐藏所有段落$(".test").hide()--隐藏所有class="test"的元素$("#test").hide()--隐藏所有id="test"的元素文档就绪函数$(document).ready(fun... 阅读全文
posted @ 2014-11-14 15:28 G-Beniot 阅读(188) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2014-11-14 14:15 G-Beniot 阅读(420) 评论(0) 推荐(0)
摘要: // 对浏览器的UserAgent进行正则匹配,不含有微信独有标识的则为其他浏览器 var useragent = navigator.userAgent; if (useragent.match(/MicroMessenger/i) != 'MicroMessenger') { ... 阅读全文
posted @ 2014-11-14 14:14 G-Beniot 阅读(444) 评论(0) 推荐(0)
摘要: if(window.orientation!=0){ var obj=document.getElementById('orientation'); alert('横屏内容太少啦,请使用竖屏观看!'); obj.style.display='block';}window.onori... 阅读全文
posted @ 2014-11-14 09:56 G-Beniot 阅读(612) 评论(0) 推荐(0)
摘要: function orient() {if (window.orientation == 90 || window.orientation == -90) {//ipad、iphone竖屏;Andriod横屏$("body").attr("class", "landscape");orientati... 阅读全文
posted @ 2014-11-14 09:55 G-Beniot 阅读(280) 评论(0) 推荐(0)