我的脚本有一些问题,我使用了JqueryUI工具提示,但是它不起作用。示例演示如下所示。
http://jsfiddle.net/VFZL7/。
$(function() {
$("a[id*='product_wrap']").tooltip({
content: function(){return $(this).html().replace('150_','')},
track: true,
});
});我希望我的工具提示指示图像petplusvn.com/files/sanpham/16/150.jpg而不是petplusvn.com/files/sanpham/16/150_1.jpg。
发布于 2014-06-09 14:33:05
您可以使用正则表达式替换这两个URL(在src和数据原件中)。
$(function() {
$("a[id*='product_wrap']").tooltip({
content: function(){
var $html = $(this).html().replace(/150_/g, '');
console.log('new HTML: '+$html);
return $html;
},
track: true,
});
});http://jsfiddle.net/7Y8Au/
https://stackoverflow.com/questions/24120745
复制相似问题