最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

Jquery使用小技巧汇总_jquery

来源:动视网 责编:小采 时间:2020-11-27 21:48:04
文档

Jquery使用小技巧汇总_jquery

Jquery使用小技巧汇总_jquery:下面列出了一些Jquery使用技巧。比如有禁止右键点击、隐藏搜索文本框文字、在新窗口中打开链接、检测浏览器、预加载图片、页面样式切换、所有列等高、动态控制页面字体大小、获得鼠标指针的X值Y值、验证元素是否为空、替换元素、延迟加载、验证元素是否存在于
推荐度:
导读Jquery使用小技巧汇总_jquery:下面列出了一些Jquery使用技巧。比如有禁止右键点击、隐藏搜索文本框文字、在新窗口中打开链接、检测浏览器、预加载图片、页面样式切换、所有列等高、动态控制页面字体大小、获得鼠标指针的X值Y值、验证元素是否为空、替换元素、延迟加载、验证元素是否存在于


下面列出了一些Jquery使用技巧。比如有禁止右键点击、隐藏搜索文本框文字、在新窗口中打开链接、检测浏览器、预加载图片、页面样式切换、所有列等高、动态控制页面字体大小、获得鼠标指针的X值Y值、验证元素是否为空、替换元素、延迟加载、验证元素是否存在于Jquery集合中、使DIV可点击、克隆对象、使元素居中、计算元素个数、使用Google主机上的Jquery类库、禁用Jquery效果、解决Jquery类库与其他Javascript类库冲突问题。

1. 禁止右键点击

2. 隐藏搜索文本框文字
Hide when clicked in the search field, the value.(example can be found below in the comment fields)

3. 在新窗口中打开链接
XHTML 1.0 Strict doesn't allow this attribute in the code, so use this to keep the code valid.

4. 检测浏览器
注: 在版本jQuery 1.4中,$.support 替换掉了$.browser 变量

5. 预加载图片
This piece of code will prevent the loading of all images, which can be useful if you have a site with lots of images.

6. 页面样式切换

7. 列高度相同
如果使用了两个CSS列,使用此种方式可以是两列的高度相同。

8. 动态控制页面字体大小
用户可以改变页面字体大小

9. 返回页面顶部功能
For a smooth(animated) ride back to the top(or any location).

11. 获得鼠标指针XY值
Want to know where your mouse cursor is?

12. 验证元素是否为空
This will allow you to check if an element is empty.

13. 替换元素
Want to replace a div, or something else?

14. jQuery延时加载功能
Want to delay something?

15. 移除单词功能
Want to remove a certain word(s)?

16. 验证元素是否存在于jquery对象集合中
Simply test with the .length property if the element exists.

17. 使整个DIV可点击
Want to make the complete div clickable?

18. ID与Class之间转换.
当改变Window大小时,在ID与Class之间切换

19. 克隆对象
Clone a div or an other element.

20. 使元素居屏幕中间位置
Center an element in the center of your screen.

21. 写自己的选择器
Write your own selectors.

22. 统计元素个数
Count an element.

23. 使用自己的 Bullets
Want to use your own bullets instead of using the standard or images bullets?

24. 引用Google主机上的Jquery类库
Let Google host the jQuery script for you. This can be done in 2 ways.

[code]//Example 1
http://www.google.com/jsapi">

google.load("jquery", "1.2.6");
google.setOnLoadCallback(function() {
// do something
});
http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js">

// Example 2:(the best and fastest way)
[/code">http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js">[/code]

25. 禁用Jquery(动画)效果
Disable all jQuery effects

26. 与其他Javascript类库冲突解决方案
To avoid conflict other libraries on your website, you can use this jQuery Method, and assign a different variable name instead of the dollar sign.

文档

Jquery使用小技巧汇总_jquery

Jquery使用小技巧汇总_jquery:下面列出了一些Jquery使用技巧。比如有禁止右键点击、隐藏搜索文本框文字、在新窗口中打开链接、检测浏览器、预加载图片、页面样式切换、所有列等高、动态控制页面字体大小、获得鼠标指针的X值Y值、验证元素是否为空、替换元素、延迟加载、验证元素是否存在于
推荐度:
标签: 操作 小技巧 使用
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top