2011-03-09 81 views
2

我使用:jQuery的弹出提示

jQuery Bubble Popup v.2.3.1 
http://maxvergelli.wordpress.com/jquery-bubble-popup/ 

你是为了有这个文件准备:

$('.bubble').CreateBubblePopup({ 
     align: 'center', 
     innerHtml: 'TEXT GOETH HERE!',   // THIS IS THE LINE 
     innerHtmlStyle: { 
      color: '#FFFFFF', 
      'text-align': 'center' 
     }, 
     themeName: 'all-black', 
     themePath: 'plugins/bubble/themes' 
    }); 

你必须明确地设置鼠标的文本结束了...是否有可能将文本设置为元素的属性?或者甚至更好,元素上的自定义属性?喜欢的东西:

innerHtml: this.attr("alt"), 

但是,这并不因为 '这个' 没有定义

回答

3

在文件准备工作功能:

$('.bubble').each(function(){ 
    $(this).CreateBubblePopup({ 
     align: 'center', 
     innerHtml: $(this).attr('mouseoverText'), 
     innerHtmlStyle: { 
      color: '#FFFFFF', 
      'text-align': 'center' 
     }, 
     themeName: 'all-black', 
     themePath: 'plugins/bubble/themes' 
    }); 
}); 
+0

辉煌!谢谢! – 2011-03-09 22:12:48