javascript - Change background color when aria-valuenow="off" -
i have following code:
<a class="ui-slider-handle ui-slider-handle-snapping ui-btn ui-shadow" aria-valuenow="off" style="left:0%">
i want change background color when aria-valuenow="on"
or style="left:100%"
. possible?
try adding following wherever you're triggering changing aria-value:
if($('.ui-slider').attr('aria-valuenow')=="on"){ $(body).css("background-color","red"); } else { $(body).css("background-color","none"); }
i'd recommend using true , false rather on , off standard practice. should allow instead:
if($('.ui-slider').attr('aria-valuenow')){ $(body).css("background-color","red"); } else { $(body).css("background-color","none"); }
Comments
Post a Comment