![](/img/trans.png)
[英]I have some problems related to Javascript and HTML5 Canvas element and PHP CURL within my game
[英]Have some problems with my javascript
我的腳本有一些問題,我使用了JqueryUI工具提示,但它不起作用。 示例演示如下。
$(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
。
您可以使用正則表達式替換兩個URL(在src和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,
});
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.