jquery 中的Click事件问题 本帖最后由 u011642368 于 2013-09-29 10:50:33 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你是不是多次邦定 click了没代码不好说 _openDialog: function(e) { var initSearchButton, _this = this; this.lastSelection = this.options.editable.getSelection(); this.options.dialog.dialog("open"); this.options.dialog.dialog("option", "title", "已上传图片"); this.options.dialog.dialog("option", "position", [e.pageX-150,e.pageY+30]); _this._search(); this.options.dialog.on('dialogclose', function() { return _this.options.editable.element.focus(); }); if (this.container == null) { this.container = jQuery("#hallo-image-browser-container-" + this.options.uuid); } if (this.paging == null) { this.paging = jQuery('.hallo-image-browser-paging', this.container); } if (this.pagingback == null) { this.pagingback = jQuery('.hallo-image-browser-paging-back', this.container); } if (this.pagingforward == null) { this.pagingforward = jQuery('.hallo-image-browser-paging-forward', this.container); } this.pagingback.on("click", function() { if($('.hallo-image-browser-paging-back').hasClass("disabled")){ return; }else{ console.log("funck"); _this.currentpage--; return _this._search(); } }); this.pagingforward.on("click", function() { if($('.hallo-image-browser-paging-forward').hasClass("disabled")){ return; }else{ console.log("funck"); _this.currentpage++; return _this._search(); } }); if (this.noresult == null) { this.noresult = jQuery('.hallo-image-browser-no-search-result', this.container); } if (this.searchvalue == null) { this.searchvalue = this.options.dialog.find('.hallo-image-browser-search-value'); } initSearchButton = function() { _this.searchbutton = _this.options.dialog.find('.hallo-image-browser-search'); return _this.searchbutton.on("click", function() { return _this._search(); }); }; return this.searchbutton != null ? this.searchbutton : this.searchbutton = initSearchButton(); }, _search: function() { var data, query, _this = this; window.console.log(this.currentpage); // query = this.searchvalue.val(); if (this.lastquery !== query) { this.currentpage = 1; this.lastquery = query; } data = { limit: this.options.limit, page: this.currentpage, query: query }; return jQuery.getJSON(this.options.searchurl, data, function(data) { _this._resetSearchResults(); _this._paging(data.page, data.total); return _this._preview_images(data.results); }); } 加上 防止事件冒泡 试试 this.pagingback.on("click", function(evt) { evt.stopPropagation(); if($('.hallo-image-browser-paging-back').hasClass("disabled")){ return; }else{ console.log("funck"); _this.currentpage--; return _this._search(); } }); this.pagingforward.on("click", function(evt) { evt.stopPropagation(); if($('.hallo-image-browser-paging-forward').hasClass("disabled")){ return; }else{ console.log("funck"); _this.currentpage++; return _this._search(); } }); 你不要把 this.pagingback.on("click", this.pagingforward.on("click", 放在 _openDialog 里 或者 判断一下是否初始 if(!this.isInit){ this.isInit=true; this.pagingback.on("click", function(evt) { evt.stopPropagation(); if($('.hallo-image-browser-paging-back').hasClass("disabled")){ return; }else{ console.log("funck"); _this.currentpage--; return _this._search(); } }); this.pagingforward.on("click", function(evt) { evt.stopPropagation(); if($('.hallo-image-browser-paging-forward').hasClass("disabled")){ return; }else{ console.log("funck"); _this.currentpage++; return _this._search(); } }); } 时间计算 jquery和js问题 关于99宿舍里的Javascript代码 javascript 如何传递页面参数 关于js新窗口和值传递 求一个隔几秒就打开某个固定网页的代码 求一段JS代码,关于层展开的,下班结帖 按照不同条件,进入一个具有左右图文框的页面,可是每次进入,都是满足前一个条件的页面?????? 朋友们:请问怎样计算出春节的日期???? 如何转换类型,得到的页面对象的id为什么显示为[object] 如果form.txt1.value中,是纯数字? iframe WINDOW.PARENT 的兼容问题
var initSearchButton,
_this = this;
this.lastSelection = this.options.editable.getSelection();
this.options.dialog.dialog("open");
this.options.dialog.dialog("option", "title", "已上传图片");
this.options.dialog.dialog("option", "position", [e.pageX-150,e.pageY+30]);
_this._search();
this.options.dialog.on('dialogclose', function() {
return _this.options.editable.element.focus();
});
if (this.container == null) {
this.container = jQuery("#hallo-image-browser-container-" + this.options.uuid);
}
if (this.paging == null) {
this.paging = jQuery('.hallo-image-browser-paging', this.container);
}
if (this.pagingback == null) {
this.pagingback = jQuery('.hallo-image-browser-paging-back', this.container);
}
if (this.pagingforward == null) {
this.pagingforward = jQuery('.hallo-image-browser-paging-forward', this.container);
}
this.pagingback.on("click", function() {
if($('.hallo-image-browser-paging-back').hasClass("disabled")){
return;
}else{
console.log("funck");
_this.currentpage--;
return _this._search();
}
});
this.pagingforward.on("click", function() {
if($('.hallo-image-browser-paging-forward').hasClass("disabled")){
return;
}else{
console.log("funck");
_this.currentpage++;
return _this._search();
}
});
if (this.noresult == null) {
this.noresult = jQuery('.hallo-image-browser-no-search-result', this.container);
}
if (this.searchvalue == null) {
this.searchvalue = this.options.dialog.find('.hallo-image-browser-search-value');
}
initSearchButton = function() {
_this.searchbutton = _this.options.dialog.find('.hallo-image-browser-search');
return _this.searchbutton.on("click", function() {
return _this._search();
});
};
return this.searchbutton != null ? this.searchbutton : this.searchbutton = initSearchButton();
},
_search: function() {
var data, query,
_this = this;
window.console.log(this.currentpage);
// query = this.searchvalue.val();
if (this.lastquery !== query) {
this.currentpage = 1;
this.lastquery = query;
}
data = {
limit: this.options.limit,
page: this.currentpage,
query: query
};
return jQuery.getJSON(this.options.searchurl, data, function(data) {
_this._resetSearchResults();
_this._paging(data.page, data.total);
return _this._preview_images(data.results);
});
}
evt.stopPropagation();
if($('.hallo-image-browser-paging-back').hasClass("disabled")){
return;
}else{
console.log("funck");
_this.currentpage--;
return _this._search();
}
});
this.pagingforward.on("click", function(evt) {
evt.stopPropagation();
if($('.hallo-image-browser-paging-forward').hasClass("disabled")){
return;
}else{
console.log("funck");
_this.currentpage++;
return _this._search();
}
});
this.isInit=true;
this.pagingback.on("click", function(evt) {
evt.stopPropagation();
if($('.hallo-image-browser-paging-back').hasClass("disabled")){
return;
}else{
console.log("funck");
_this.currentpage--;
return _this._search();
}
});
this.pagingforward.on("click", function(evt) {
evt.stopPropagation();
if($('.hallo-image-browser-paging-forward').hasClass("disabled")){
return;
}else{
console.log("funck");
_this.currentpage++;
return _this._search();
}
});
}