0

I want to send a dynamic data in calc() of csss on every change ,Showing you some code to understand the requirement

I am getting my data in class countDist and want send in place of 33 in calc function

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="progress-group">
  <div class="countDist"></div>
  <div class="progress sm">
    <div class="progress-bar progress-bar-red" style="width: calc((100%)-33/100)"></div </div>
  </div>
$.getJSON('timeLineDataforDistToState', {
  stateCode: $(this).val(),
  ajax: 'true'
}, function(data) {
  var a = data;
  $('.countDist').html(a);
});
2
  • if you already using javascript, calc() is irrelevant
    – user7148391
    Commented Dec 11, 2019 at 12:32
  • @ZohirSalak I have to do using jsp,I am creating some progress bar,can u pls help me out,If i am sending static value 33 then its working fine but i have to send dynamic data on every change thats coming in my countDist class Commented Dec 11, 2019 at 12:35

1 Answer 1

1

Maybe you can use CSS in JS like this :

$('.countDist').css('width', '<YOUR_VALUE>');

Not sure it works, it's been a long time since I've used jQuery

1
  • thanx for you contribution ,but i think you didin't got my question,the value is coming in class countdist Commented Dec 11, 2019 at 12:37

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.