您当前位置: 首页 » web前端 »

jquery

分类目录归档: jquery - 第2页

jquery 判断radio是否选中

最直接就用 is(“:checked”) if ( $(“input:radio”) .is(“:checked”)) { alert(“选中”); } 如果判断选中同时还要取值的话,可以用以下代码 var value=$( …

read more

jquery 实现多级悬浮菜单

好不容易编的样式,领导一否决就要全部删掉了。领导可以不珍惜我们的劳动,我们自己要珍惜,所以我把这段代码贴出来,写的不好的地方大家多担待。 //jquery代码:   $(document).ready(function(){ $(“.orderleft”).children(&#822 …

read more

jquery为iframe绑定click事件

iframe是不支持js的onclick事件的,用jquery的click事件也不行。但是我们可以换个思路,点击iframe不行我们可以给iframe里面的body绑定click事件。这是可行的。但是需要注意一点就是要等iframe加载完之后才能实现。 $(“#ifr”).on(“l …

read more

jquery对象转换成dom对象并传递

我们经常会用到setTimeout函数,setTimeout里面又经常会调用方法。例如: setTimeout(‘tanchuang()’,500); 但是如果函数需要传参,以上方法就不适用了。 setTimeout(‘tanchuang(obj)’,500);//会报错 …

read more

用JQuery 判断某个属性是否存在hasAttr()

if(typeof($(“#id”).attr(“onmouseout”))==”undefined”){ alert(“属性onmouseout不存在”); } else{ alert(“属性onmouseou …

read more

jQuery删除元素的属性removeAttr()

在Jquery中通过attr()方法设置元素的属性后,使用removeAttr()方法可以将元素的属性删除。 语法格式为:removeAttr(name) removeAttr(“onmouseout”); removeAttr(“onmouseover”); 也可以删除 …

read more

jquery判断checkbox是否选中以及设置select的默认项

jquery判断checkbox是否选中 if($(“input[type=’checkbox’]”).is(‘:checked’)) { alert(“选中”); } else { alert(“未选中&#82 …

read more

jquery计数小代码

这是一个不是单纯的1+1的计数代码。。。 <script type=”text/javascript” src=”http://web.zhaicool.net/jquery.js”></script> <script> $(docum …

read more

jquery图片自动&手动滚动代码

jquery图片自动&手动滚动代码 <!DOCTYPE> <html> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ …

read more

jquery修改iframe上层元素信息

$(document).ready(function() { var bodyheight=document.body.clientHeight;//获取屏幕可视区高度 $(parent.document.body).css(“height”,bodyheight+”px&#8221 …

read more