javascript - Unexpected string in JS with CSS -


i write small page , in code have error. want use way because isotope doesn't read width , height styles in html tags.

var winw = $(window).width(); var plmt_w = winw / 10; var plmt_h = plmt_w;  var css = '.plmt { width:' plmt_w '; height:' plmt_h ';}', ..... 

as ajm , amit joki said, need + operators concatenate strings.

but, since $(window).width() returns unitless value, need add 'px' valid css string:

var css = '.plmt { width:' + plmt_w + 'px; height:' + plmt_h + 'px;}', 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -