.html文件
<div data-role = "collapsible">
<h3 class = "title">
<div class = "specialCollectionValue" >' + obj.specialCollection + ' </div>
</h3>
</div>
这里的obj.specialCollection ,作用是,如果在html中点击加入收藏,
那么在js中设置将
<img src = "css/images/StarPng.png" class = "StarPng">
这一个img标签(星星图片)加入到这个div标签里,js代码如下
.js文件
let specialCollection = document.getElementById("addPopup_specialCollectionInput").checked;
if(specialCollection == true){
//specialCollection = $.i18n.prop('specialCollection');
specialCollection = '<img src = "css/images/StarPng.png" class = "StarPng">';
} else {
specialCollection = "";
}
这一段是html中的添加收藏按钮,如果选中,那么在html中插入图片标签。显示星星符号。