i have some problems with my script , i used JqueryUI tooltip but it doesn't work . Sample demo is given below.
$(function() {
$("a[id*='product_wrap']").tooltip({
content: function(){return $(this).html().replace('150_','')},
track: true,
});
});
I want my tooltip indicates the image petplusvn.com/files/sanpham/16/150.jpg
instead of petplusvn.com/files/sanpham/16/150_1.jpg
.
You can use regular expressions to replace both URLs ( in src and data-original )
$(function() {
$("a[id*='product_wrap']").tooltip({
content: function(){
var $html = $(this).html().replace(/150_/g, '');
console.log('new HTML: '+$html);
return $html;
},
track: true,
});
});