Add Attribute Jquery data type string + variable -
i have variable called vp_height
want put data variable, putting this, prompt error.
var vp_height = viewportsize.getheight(); //sample data $(".carol").attr({ "data-" + vp_height : "width:50%;" });
here's error
it should in frontend. (visual presentation)
<div class="staff-container carol" data-667="width:50%;"></div>
any solution stuff?
Comments
Post a Comment