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

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

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