ImageVerifierCode 换一换
格式:DOCX , 页数:4 ,大小:17.14KB ,
资源ID:2775063      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/2775063.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(jquery常用小功能总结.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

jquery常用小功能总结.docx

1、jquery常用小功能总结1. 禁止右键点击$(document).ready(function() $(document).bind(contextmenu,function(e) return false; ););2. 隐藏搜索文本框文字点击时隐藏搜索栏中的文字$(document).ready(function() $(input.text1).val(Enter your search text here); textFill($(input.text1);); function textFill(input) /input focus text function var origi

2、nalvalue = input.val(); input.focus( function() if( $.trim(input.val() = originalvalue ) input.val(); ); input.blur( function() if( $.trim(input.val() = ) input.val(originalvalue); );3. 在新窗口中打开链接页面中所有链接都在新窗口中打开$(document).ready(function() /Example 1: Every link will open in a new window $(ahref=http

3、:/).attr(target, _blank); /Example 2: Links with the rel=external attribute will only open in a new window $(arel$=external).click(function() this.target = _blank; ););/ how to useopen link4. 检测浏览器检测客户端使用的什么浏览器$(document).ready(function() / Target Firefox 2 and aboveif ($.browser.mozilla & $.browser

4、.version = 1.8 ) / do something / Target Safariif( $.browser.safari ) / do something / Target Chromeif( $.browser.chrome) / do something / Target Caminoif( $.browser.camino) / do something / Target Operaif( $.browser.opera) / do something / Target IE6 and belowif ($.browser.msie & $.browser.version

5、6) / do something);5. 预加载图片预加载图片,适用网站图片很多的网站$(document).ready(function() jQuery.preloadImages = function() for(var i = 0; iARGUMENTS.LENGTH; jQuery(?).attr(src, argumentsi); / how to use$.preloadImages(image1.jpg););6. 页面样式切换$(document).ready(function() $(a.Styleswitcher).click(function() /swicth th

6、e LINK REL attribute with the value in A REL attribute $(linkrel=stylesheet).attr(href , $(this).attr(rel); );/ how to use/ place this in your header/ the linksDefault ThemeRed ThemeBlue Theme);7. 列高度相同如果使用了两个CSS列,使用此种方式可以是两列的高度相同。$(document).ready(function() function equalHeight(group) tallest = 0;

7、 group.each(function() thisHeight = $(this).height(); if(thisHeight tallest) tallest = thisHeight; ); group.height(tallest);/ how to use$(document).ready(function() equalHeight($(.left); equalHeight($(.right);););8. 动态控制页面字体大小用户可以改变页面字体大小$(document).ready(function() / Reset the font size(back to def

8、ault) var originalFontSize = $(html).css(font-size); $(.resetFont).click(function() $(html).css(font-size, originalFontSize); ); / Increase the font size(bigger font0 $(.increaseFont).click(function() var currentFontSize = $(html).css(font-size); var currentFontSizeNum = parseFloat(currentFontSize,

9、10); var newFontSize = currentFontSizeNum*1.2; $(html).css(font-size, newFontSize); return false; ); / Decrease the font size(smaller font) $(.decreaseFont).click(function() var currentFontSize = $(html).css(font-size); var currentFontSizeNum = parseFloat(currentFontSize, 10); var newFontSize = curr

10、entFontSizeNum*0.8; $(html).css(font-size, newFontSize); return false; ););9. 返回页面顶部功能网站很常用的功能,增强用户体验$(document).ready(function() $(ahref*=#).click(function() if (location.pathname.replace(/,) = this.pathname.replace(/,) & location.hostname = this.hostname) var $target = $(this.hash); $target = $tar

11、get.length & $target | $(name= + this.hash.slice(1) +); if ($target.length) var targetOffset = $target.offset().top; $(html,body) .animate(scrollTop: targetOffset, 900); return false; );/ how to use/ place this where you want to scroll to/ the linkgo to top);11. 获得鼠标指针值$(document).ready(function() $

12、().mousemove(function(e) /display the x and y axis values inside the div with the id XY $(#XY).html(X Axis : + e.pageX + | Y Axis + e.pageY); );/ how to use );12. 验证元素是否为空$(document).ready(function() if ($(#id).html() / do something );13. 替换元素$(document).ready(function() $(#id).replaceWith(I have be

13、en replaced ););14. jQuery延时加载功能$(document).ready(function() window.setTimeout(function() / do something , 1000););15. 移除单词功能$(document).ready(function() var el = $(#id); el.html(el.html().replace(/word/ig, ););16. 验证元素是否存在于jquery对象集合中$(document).ready(function() if ($(#id).length) / do something );17. 使整个DIV可点击$(document).ready(function() $(div).click(function() /get the url from href attribute and launch the url window.location=$(this).find(a).attr(href); return false; );/ how to usehome );18. ID与Class之间转换.当改变Win

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1