craigsworks.com - Support Forum

Full Version: [Solved] [Solved] How to set qtip2 to hide after ajax completes?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[php]
$('#submit').qtip({
content:{
text:status_tip_html('loading',SYSMSG.M00002),
ajax:{
url:SYSMSG.G00001,
type:'post',
dataType:'json',
data:ajax_data,
success:function(data){
/* success */
if(data.status === 'success'){
jQuery(_this.commentlist_id+data.des.post_id).prepend(data.des.content);
/* I d want to set this qtip to hide in here, how to write the codes? */

}
}
}
}
});
[/php]
I am not so clear. could you tell me? thank you.
Within the ajax callbacks, "this" refers to the API instance, so...
JS Code
success:function(data){
                /* success */
                if(data.status === 'success'){
                    jQuery(_this.commentlist_id+data.des.post_id).prepend(data.des.content);
                    /* I d want to set this qtip to hide in here, how to write the codes? */
                    this.hide();
                }
            }
(3rd October 13:17)Craig Wrote: [ -> ]Within the ajax callbacks, "this" refers to the API instance, so...
JS Code
success:function(data){
                /* success */
                if(data.status === 'success'){
                    jQuery(_this.commentlist_id+data.des.post_id).prepend(data.des.content);
                    /* I d want to set this qtip to hide in here, how to write the codes? */
                    this.hide();
                }
            }
thanks again man.
I can feel you have a great powerSmile
excuse me. I d want to know, how to make the effect in qtip after ajax?
JS Code
success:function(data){
	if(data.status === 'success'){
		this.set('content.text',data.des.content);
 
		/* ↓↓↓↓↓ is it right? i d want to "reposition" the qtip, but it has not effect. ↓↓↓↓↓ */
		this.reposition({at:'top center',my:'bottom center'});
		/* ↑↑↑↑↑ end the codes ↑↑↑↑↑ */
 
	}else{
 
	}
}

thank you very much.
Use this.set, not this.reposition Smile

JS Code
this.set({ 'position.at': 'top center', 'position.my': 'bottom center'});
thank you very muchSmile
And i d want to know where to get your idea? The documentation does not describe, where i get it? Thank you CraigSmile
Reference URL's