2018年通车的高铁:jqury使用的几个小技巧
来源:百度文库 编辑:偶看新闻 时间:2024/05/05 08:41:52
1) 检查IE是否是版本6
- if ( (jQuery.browser.msie) && (parseInt(jQuery.browser.version) < 7) ) {
- $('body').prepend('You are using an old version of Internet Explorer which is not supported. Please upgrade your browser in order to view this website.');
- }
2) 打开一个打印的窗口
- [url=#]Print this page[/url]
- $('a.print').click(function(){
- window.print();
- return false;
- })
3) 禁止表单使用回车键
- $("#form").keypress(function(e) {
- if (e.which == 13) {
- return false;
- }
- });
4) 全选和反选checkbox
-
- [list]
- [*][url=#]Select All[/url]
- [*][url=#]Reset All[/url]
- [/list]
- $('.select-all').live('click', function(){
- $(this).closest('.options').find('input[type=checkbox]').attr('checked', true);
- return false;
- });
- $('.reset-all').live('click', function(){
- $(this).closest('.options').find('input[type=checkbox]').attr('checked', false);
- return false;
- });
5) 平均分各个列
有的时候,需要在表格中让各个列等分,可以这样
- var max_height = 0;
- $("div.col").each(function(){
- if ($(this).height() > max_height) { max_height = $(this).height(); }
- });
- $("div.col").height(max_height);
6 将所有的连接用新建窗口打开
- $('a[@rel$='external']').click(function(){
- this.target = "_blank";
- });
- /*
- Usage:
- [url=http://www.catswhocode.com]catswhocode.com[/url]
- */
foxmai的使用小技巧
发泥的使用小技巧
word 使用小技巧
cmd 使用小技巧
关于使用word使用的一些小技巧
能介绍个全是电脑维护小技巧和使用小技巧的网站吗?
谁能教我几个运用计算机的小技巧啊??
谈谈微软拼音的几个使用技巧吧
QQ空间使用的小技巧,不要用代码的!
急需一篇关于C++使用小技巧的论文
求婚的小技巧!
qq的小技巧
AK47的使用技巧??、
使用搜索引擎的技巧
Windows2000的使用技巧
键盘的技巧使用
者哩膏的使用技巧?
微波炉的使用技巧
frontpage的使用技巧
Excel2003的使用技巧?
笔记本电脑的使用技巧?
word的使用技巧
autoCAD的使用技巧
6688的使用技巧