TwitterBootstrap + mvc, how to pass dynamic width to boostrap .less class -
i using twitterbootstrap , want pass button width dynamic..like below code
i want pass "@wth" value dynamically client side(from view(mvc)). right it's coming*statically* on varibles.less file....but want pass straight view(mvc).
so, best solution ?
although gives impression of beingness able dynamic things if utilize less.js in browser, styles compiled css files, , have fixed values time applied html. you can't alter values of less variables after page loads.
if need alter width of button dynamically based on few pre-set sizes, i'd should add together classes css (small, medium, large, etc.), , dynamically add together class css via jquery's addclass method.
if need set width directly, i'd utilize jquery's css method.
if you're going doing lot of sort of thing, may want using data-binding library can bind javascript object html styles, such knockout.
less
No comments:
Post a Comment