How to create a mootool tooltip with Ajax response -


how create mootool tooltip ajax response.anybody can please suggest me tutorial same.

what have tried far?

you way btw:

set inside parent tippable elements data-attribute store url (needed retrieve tooltip ajax) i.e.:

<div class="tippable" data-tipurl="/some/url/">   when mouseover here, tip appears </div> 

then, js, create , cache tips i.e.:

$$('div.tippable').each(function(tippable){      tippable.addevents({          'mouseenter' : function(){              if(!this.retrieve('tip')){ //first time, build tip!                  var tip = new element('div.tip');                  tip.set('load',{/* options */});                  tip.load(this.get('data-tipurl')); //get through ajax                   tip.inject(this, 'top').setstyles({ //set tip style                     position : 'absolute'                     /* etc... */                 });                  this.store('tip', tip); //store inside parent              }else{ // built, show                  this.retrieve('tip').setstyle('display', 'block');             }         },          'mouseleave' : function(){             var tip = this.retrieve('tip'); //retrieve tip              if(tip){ //if it's built, hide                tip.setstyle('display','none');              }              //otherwise, nothing         }      }); }); 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -