我正在尝试将丰富的片段添加到显示星星的动态图像中。我的购物车写的唯一内容就是这个图像,所以我必须找到正在显示的图像,然后添加正确的元标记。
因此,如果显示的图像是 1stars.gif 我必须写:
<meta itemprop="ratingValue" content="1" />
如果显示的图像是 5stars.gif 我必须写:
<meta itemprop="ratingValue" content="5" />
这是更新的完整示例:
<span id="rateitnow">
{module_ratingrank,images/icons/stars}
<meta itemprop="ratingValue" content="" />
</span>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#rateitnow meta').attr('content', $('#rateitnow').find('img:first').attr('src').substr(0,1));
});
</script>
$('#rate-me meta').attr('content', $('#rate-me').find('img:first').attr('src').substr(0,1));
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)