2011-01-13 26 views
0

直播提示我有提示的工作版本(jQuery的工具 - http://flowplayer.org/tools/demos/tooltip/index.html),jQuery的工具 - 阿贾克斯

jQuery(document).ready(function() { 
jQuery('.more_info').each(function(){ 
    jQuery(this).tooltip({ 
     effect: 'slide', 
     offset: [10, 570], 
     predelay: 100, 
     position: "bottom left"}).dynamic({ 
     bottom: { 
     direction: 'down', 
     bounce: true 
    } 
    }); 
}); 

});

AJAX加载后,提示不工作了,因为,剧本已经被加载,我试图从论坛http://flowplayer.org/tools/forum/30/37281解决方案,但没有工作,或者未正确执行

这里是代码:

jQuery(document).ready(function() { 
jQuery('.more_info').each(function(){ 
    jQuery(this).not('.tt_init').tooltip({ 
     effect: 'slide', 
     offset: [10, 570], 
     predelay: 100, 
     position: "bottom left"}).dynamic({ 
     bottom: { 
     direction: 'down', 
     bounce: true 
     } 
    }); 
    jQuery(this).not('.tt_init').addClass('tt_init'); 
}); 

});

并没有什么......我做错了,谢谢你的帮助),对不起我的英语不好

+0

你并不需要jQuery插件的`each`。这是矫枉过正。 – 2011-01-13 16:07:08

+0

我是jquery的新手,如果它是鼠标悬停,那么更好的方法是什么 – mIRU 2011-01-13 16:21:42

回答

2

如果问题是动态的内容,你可以尝试使用jQuery的live API。

jQuery('.more_info').live('mouseover', function(){ 
    // may need to check here if it already has a tooltip (depending on plugin) 
    jQuery(this).tooltip({ 
     effect: 'slide', 
     offset: [10, 570], 
     predelay: 100, 
     position: "bottom left"}).dynamic({ 
      bottom: { 
      direction: 'down', 
      bounce: true 
     } 
    }); 
}); 

另一种解决方案是手动激活ajax内容的工具提示。例如:

$('#result').load('ajax/test.html', function() { 
    $(this).find('.more_info').tooltip({*/...*/}); 
}); 

或者您可以使用global responders对所有ajax请求执行此操作。