我想在我的产品页面上列出类似的产品。它正在工作,但每次都会在我的数据库上获得最后的产品。感谢英语不好。谢谢。
<script type="text/javascript">
jQuery(function(){
jQuery.ajax({
url: "/index.php?do=catalog/ajax",
data: "ref=getSimilar&productId={urun_id}",
success: function(data) {
jQuery('.similarProduct .productsContent ul').html(data);
if(jQuery('.similarProduct li').length){
jQuery('.similarProduct .productsContent').carousel({
direction: "horizontal",
dispItems: 4,
loop: true,
pagination: false,
autoSlide: true,
autoSlideInterval: 3000,
animSpeed: 1000
});
}
}
});
});
</script>
答案 0 :(得分:-1)
Try This
<script type="text/javascript">
jQuery(function(){
jQuery.ajax({
url: "/index.php?do=catalog/ajax",
data: "ref=getSimilar&productId={urun_id}",
success: function(data) {
jQuery('.similarProduct, .productsContent, ul').html(data);
if(jQuery('.similarProduct li').length>0){
jQuery('.similarProduct, .productsContent').carousel({
direction: "horizontal",
dispItems: 4,
loop: true,
pagination: false,
autoSlide: true,
autoSlideInterval: 3000,
animSpeed: 1000
});
}
}
});
});
</script>