首页 › Category Archives › JQuery

jQuery 1.4官方文档中文版发布

jQuery 1.4 发布啦

为了庆祝jQuery的四周岁生日, jQuery的团队荣幸的发布了jQuery Javascript库的最新主要版本! 这个版本包含了大量的编程,测试,和记录文档的工作,我们为此感到很骄傲。

我要以个人的名义感谢 Brandon Aaron, Ben Alman, Louis-Rémi Babe, Ariel Flesler, Paul Irish, Robert Kati?, Yehuda Katz, Dave Methvin, Justin Meyer, Karl Swedberg, and Aaron Quint。谢谢他们在修复BUG和完成这次发布上所做的工作。 继续阅读 »

个人JQuery学习笔记—Sortable,表格拖动排序

使用Jqery实现类似igoogle的功能是很方便的。使用sortable方式实现。其中有一些参数很重要:

appendTo: ‘parent’ 覆盖于父子节,防止鼠标拖拽时被遮挡

axis: false 仅限制于X/Y轴移动

cancel: ‘:input,button’ 当拖拽匹配元素时,阻止拖拽

connectWith: false 允许此 sortable 拖拽至其他 sortable 继续阅读 »

jQuery—blockUI-V2翻译

The jQuery BlockUI 插件是用于进行AJAX操作时模拟同步传输时锁定浏览器操作。
当它被激活时,它会阻止使用者与页面(或页面的一部分)进行交互,直至它被取消。
BlockUI以在DOM中添加元素的方法来实现阻止用户与浏览器交互的外观和行为。

中文翻译:

http://www.cssrain.cn/demo/blockUI-V2/jQuery/blockUI/jQueryBlockUI.html

下载:

http://www.cssrain.cn/demo/blockUI-V2/blockUI-V2.rar

Jquery drop and drag Sortable在Ie 6 ie7 下不兼容的解决办法

使用Jquery的drop and drag方面的插件是,在Firefox 和chrome、IE8下都非常正常,但是在IE6 IE7下,一拖动,就会很乱,出现了对象拖动不准确的现象,查了下资料,发现时因为IE里的事件冒泡在作怪。

解决办法:
继续阅读 »

jquery radio,checkbox,select操作

获取一组radio被选中项的值
var item = $(‘input[@name=items][@checked]‘).val();
获取select被选中项的文本
var item = $(“select[@name=items] option[@selected]“).text();
select下拉框的第二个元素为当前选中值
$(‘#select_id’)[0].selectedIndex = 1;
radio单选组的第二个元素为当前选中值
$(‘input[@name=items]‘).get(1).checked = true;
继续阅读 »

jQuery-ui Dialog 如何保存移動後的位置

最近在玩這個東西, 不過我真正開始玩 jQuery 還不滿一個月
很多功能也不知道是不是已經有了, 例如在關閉 dialog 之後
如果關閉前有移動過位置, 再開啟時 dialog 的位置卻會回到最初設定的
不會自動在最後移動的位置, 雖然可以在 dragStop 事件做這個處理
但是如果每次開個 dialog 都還要另外處理也是很麻煩的啊
估狗爬了好久, 找不到比較好的解決方式
於是就直接拿 jQuery source code 開刀..
继续阅读 »

自己修改后的 Jquery autocomplete ,添加逗号分隔

/*!
* Auto Complete 4.1
* October 25, 2009

*/
;(function($, undefined){
var tempvalue=”;
// Expose autoComplete to the jQuery chain
$.fn.autoComplete = function(){
// Force array of arguments
var args = Array.prototype.slice.call(arguments);

// Autocomplete special triggers
if (typeof args[0] === ‘string’)
// Trigger the requested function, and dont break the chain!
return $(this).trigger(‘autoComplete.’+args.shift(), args);

// Initiate the autocomplete
return autoComplete.call(this, args[0]);
};

// bgiframe is needed to fix z-index problem for IE6 users.
$.fn.bgiframe = $.fn.bgiframe ? $.fn.bgiframe : $.fn.bgIframe ? $.fn.bgIframe : function(){
// For applications that don’t have bgiframe plugin installed, create a useless
// function that doesn’t break the chain
return this;
};
// Autocomplete function
var inputIndex = 0, autoComplete = function(options){
return this.each(function(){
// Cache objects
var $input = $(this).attr(‘autocomplete’, ‘off’), $li, timeid, timeid2, blurid,
// Internal Per Input Cache
cache = {
length: 0,
val: undefined,
list: {}
}, 继续阅读 »

Jquery判断checkbox是否被选中

判断语句

if($(‘input:checkbox’).attr(“checked”)==true)

继续阅读 »