Monday 17 July 2017

Dynamic CSS using handlebars values?

Hey guys, sorry if this is a bit of a noob Q. I'm a beginner to html/js/css.I'm trying to create a HandleBars template of a crowdfunding thermometer. My problem is that I need the dynamic value to determine the width of the progress bar inside the Handlebars template, which requires CSS. I'm confused about the concept of dynamic CSS or whether it's possible.Effectively, the progress on the thermometer is based on an aggregated value called from Google Sheets, which is plugged into HandleBars.I need the width of the 'progress' div to be equal to percComplete.Javascriptvar RBITemplate = Handlebars.compile($('#team-rbi-template').html()); $('#total').sheetrock({ url: mySpreadsheet, query: "select sum(B)/100 where (A = 'Donate $2 to Test Campaign')", labels: ['percComplete'], rowTemplate: RBITemplate }); Handlebars HTML template - here's where I'm stuck

No comments:

Post a Comment