I am trying to implement a plugin:
$(".myTbl th:nth-child(1)").truncate({
width: "200",
after: "…",
center: false,
addtitle: true
});
Instead of using a fixed value for width, I have a script that calculates it dynamically and sets it into a a variable, but when I plug it in the code breaks. What am I missing? it is all withing PHP code
echo '
var myWidth = 150;
$(".myTbl th:nth-child(1)").truncate({
width: myWidth ,
after: "…",
center: false,
addtitle: true
}); ';