Applying a % style binding with knockout via function not working
I want to set the width of a div equal to a percentage calculated by a
javascript method. I can get knockout to apply the style binding properly
using this:
<div class="bar" data-bind="style: { width: '50%'}"></div>
but when I try to use a function to generate the output, it breaks:
<div class="bar" data-bind="style: { width: function(){return '50' +
'%';}}"></div>
No comments:
Post a Comment