随笔分类 - JQuery
摘要:今天开发的时候碰到了一个奇怪的问题 Document 如上所示一样,例子很像是这个问题http://stackoverflow.com/questions/17461452/ie-8-jquery-1-7-1-element-parentsselector-returns-sib...
阅读全文
摘要:/******************************************* 字符串函数扩充 *******************************************//*===========================================//去除左边的空格===========================================*/String.prototype.LTrim = function(){ return this.replace(/(^\s*)/g, "");}/*===================
阅读全文
摘要:jquery中利用navigator.userAgent.indexOf来判断浏览器类型,并进行了一下处理,如果不想使用jquery,稍为修改下代码就可以为自己所用jquery判断浏览器的源码(jquery1.31为例)Js代码:varuserAgent=navigator.userAgent.toLowerCase(); //FigureoutwhatbrowserisbeingusedjQuery.browser={ version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/:]([\d.]+)/)||[0,'0'])[1], safari
阅读全文
摘要:Or do you want to really fade-in the element like this:
阅读全文
摘要://遍历option和添加、移除optionfunction changeShipMethod(shipping){var len = $("select[@name=ISHIPTYPE] option").lengthif(shipping.value != "CA"){$("select[@name=ISHIPTYPE] option").each(function(){if($(this).val() == 111){$(this).remove();}});}else{$("option value='111'UPS Ground/option").appendTo($("se
阅读全文
摘要:script type="text/javascript"function mousePosition(ev){ if(ev.pageX || ev.pageY) { return {x:ev.pageX, y:ev.pageY}; } return { x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,y:ev.clientY + document.body.scrollTop -document.body.clientTop };} function mouseMov
阅读全文
摘要:var search_str = /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/;var email_val = $("#Email").val();if(!search_str.test(email_val)){ alert("please input right email !");$('#Email').focus();return false;}
阅读全文
摘要:ActiveState的开源开发工具 Komodo加了强大的Jquery代码编写支持。用的很爽!推荐之
阅读全文
摘要:jQuery是一款同prototype一样优秀js开发库类,特别是对css和XPath的支持,使我们写js变得更加方便!如果你不是个js高手又想写出优 秀的js效果,jQuery可以帮你达到目的! 下载地址:Starterkit (http://jquery.bassistance.de/jquery-starterkit.zip) jQuery Downloads (http://jquery....
阅读全文
摘要:获取一组radio被选中项的值var item = $('input[@name=items][@checked]').val();获取select被选中项的文本var item = $("select[@name=items] option[@selected]").text();select下拉框的第二个元素为当前选中值$('#select_id')[0].selectedIndex = 1;...
阅读全文
摘要:<html><head> <title>Table Test</title> <meta name="generator" content="Editplus" /> <meta name="author" content="PJ" /> <script language="JavaScript"> <!-- function Delete() { var dgTable=document.getEleme
阅读全文