1/* edited from wp-content/themes/boozurk/boozurk.js to work with dokuwiki */ 2 3function cooltips(){ 4 5// alert("123"); 6 var baloon = jQuery('<div class="cooltip"></div>'); 7 baloon.appendTo("body"); 8 var timeoutID; 9 10 jQuery(".minibutton").each(function() { 11 jQuery(".minibutton").hover(function(){ 12 // jQuery("body").delegate(".minibutton", 'hover', function() { 13 var $this = jQuery(this); 14 15 // console.log($this); 16 // alert("rollover"); 17 18 /* 19 var offset,h_pos,pin_pos; 20 if ($this.attr('title') || typeof($this.attr('original-title')) != 'string') { 21 $this.attr('original-title', $this.attr('title') || '').removeAttr('title'); 22 } 23 */ 24 25 baloon.html($this.attr('original-title')); 26 27 28 offset = $this.offset(); 29 baloon.css({top: 0, left: 0, display: 'block'}).removeClass('to_left to_right'); 30 31 if ( offset.left > ( jQuery(window).width() - 250 ) ) { 32 h_pos = offset.left - baloon.outerWidth() + ( $this.outerWidth() / 2 ); 33 pin_pos = 'to_left'; 34 } else { 35 h_pos = offset.left + ( $this.outerWidth() / 2 ); 36 pin_pos = 'to_right'; 37 } 38 39 baloon.css({top: offset.top - baloon.outerHeight() - 10, left: h_pos}).addClass(pin_pos); 40 window.clearTimeout(timeoutID); 41 baloon.stop().css({opacity: 0}).animate({opacity: 0.9}); 42 }); 43 }); 44 45 // baloon.fadeOut(); 46 47 jQuery(".minibutton").mouseleave(function(){ 48 baloon.stop().css({opacity: 0}).animate({opacity: 0.9}); 49 jQuery(".cooltip").fadeOut(200); 50 }); 51 52 53 54 55 function runtwo(){ 56 57 timeoutID = window.setTimeout( function(){baloon.fadeOut()}, 200); 58 59 } 60 61 // runone(); 62 // runtwo(); 63} 64 65cooltips();