javascript

LESS How to change a progress bar background color when it reaches 100%  #angularjs #reactjs

  • Stack Overflow works best with JavaScript enabled
  • LESS and CSS are not built to perform such a task.
  • paste your progress bar html code too – Abdelaziz Mokhnache 2 hours ago
  • Hi I’m just getting started with LESS, CSS, Javascript, and HTML as I a building a website.
  • full to change the background-color in your LESS. – Jordi Nebot 3 hours ago

Hi I’m just getting started with LESS, CSS, Javascript, and HTML as I a building a website. I was wondering if it was possible to use LESS to check to see if the width of an element is 100% and once it is change the background color. Like a progress bar being completed. If it’s not possible would I use Javascript? Where would I define that statement using the example:

@ng_real_ninja: LESS How to change a progress bar background color when it reaches 100% #angularjs #reactjs

Hi I’m just getting started with LESS, CSS, Javascript, and HTML as I a building a website. I was wondering if it was possible to use LESS to check to see if the width of an element is 100% and once it is change the background color. Like a progress bar being completed. If it’s not possible would I use Javascript? Where would I define that statement using the example:

Javascript function:

HTML:

That’s not really how CSS works. CSS is declarative, and the notion of “checking” element size doesn’t make much sense. – Pointy 3 hours ago

for CSS. CSS is a set of rules that get applied to a document and does not hold any information about the structure of the document. For that task you will need to use JavaScript (or jQuery – which is a JavaScript library), after the page has been loaded. – Andrei Gheorghiu 3 hours ago

in your LESS. – Jordi Nebot 3 hours ago

I added the javascript function to the main post. Would I do something like if percentage = “100” then .addClass .full to the correct class? – Torewin 2 hours ago

javascript