Qustion: using 'this' in click()
when using "this" in object.click( function(){ ... } )
"this" referes to "object".
here is some code
I wanna call fnHide() in click()
and i don't want to use ...oTip.fnHide()
what can i do?
- oTip: {
- _bToBeAppended: true, //初始化用,勿改
- oTipPanel: {}, //oTip的jQuery对象
- nFadeOutTime: 250, //淡出所用时间
- /*
- * Function: fnShowTip
- * Purpose: 在页面右上角显示提示框
- * Returns: object:oTip - 提示框的jQuery对象
- * Inputs: string:sHtml - 提示框内容的HTML代码
- * [number:nLiveTime] - 显示时间(0表示一直显示) default:0
- */
- fnShow: function( sHtml, nLiveTime ){
- nLiveTime = nLiveTime || 0;
-
- if (this._bToBeAppended) {
- this.oTipPanel = $("<div class='tip-panel'></div>").appendTo("#page");
- this._bToBeAppended = false;
- };
-
- var oTipWrapper = $("<div class='tip-wrapper'></div>").appendTo(this.oTipPanel.html(""));
- oTipWrapper
- .append( $("<div class='icon-close fn-close' title='" + auhr.localization.ui.ajax.lang.sClose + "'>×</div>") )
- .append( $("<div class='tip-content'></div>").append(sHtml) )
- .find(".fn-close").click( %%%%%%%%%%%%%% );
-
- if (nLiveTime) {
- this.fnHide(nLiveTime);
- };
-
- return this;
- },
-
- fnHide: function(nLiveTime){
- nLiveTime = nLiveTime || 0;
- this.oTipPanel.find(".tip-wrapper").stop(true,false).delay(nLiveTime).fadeOut(this.nFadeOutTime);
- }
- }