I have two variables like :
<script language="javascript" type="text/javascript">
var count = 1;
calc_my_project_ + count = Math.round( count * 268 / 100); // It shoud be calc_my_project_1 and next time it shoud be calc_my_project_2
count += count + 1;
</script>
At now result is calc_my_project_ + count . how can I do this ?
EDIT : This is my main code :
<script language="javascript" type="text/javascript">
var count = 1;
var str = 'calc_my_project_';
var str2 = 'my_pro_';
var result = str + count;
result = Math.round( @Html.DisplayFor(x => item.ProgressPercent) * 268 / 100);
var secresult = str2 + count;
secresult = "-" + result + "px 0";
var jq3 = jQuery.noConflict();
jq3(document).ready(function () {
jq3("#bar-pro-@barcount1st").css({ "background-position": secresult });
if (@Html.DisplayFor(x => item.ProgressPercent) == 100) {
jq3("#bar-pro-@barcount1st").css({ "background-image": "none" });
jq3("#bar-pro-@barcount2st").css({ "background-image": "none" });
};
});
count++;
</script>
result and secresult return a fixed value I don’t want to be like this .
You can do it like: