I want to write the value of range input to the thumb. I looked to every single question about this I could find on Google and I didn't find a solution.
I also want to when the value is 10001
I want it to show ∞
instead.
I have tried:
$('#km').on('input', function() {
if ($(this).val() === "10001") {
console.log("infinity");
$(this).addClass("range-infinite")
} else {
$(this).removeClass("range-infinite");
}
});
.range {
-webkit-appearance: none;
-moz-apperance: none;
background-image: linear-gradient(to right, #1299E6, #A0D9F9);
width: 90%;
margin-left: 70px;
height: 1px;
margin-bottom: 40px;
border-top: none;
}
.range::-webkit-slider-thumb {
appearance: none;
-webkit-appearance: none;
-moz-apperance: none;
height: 30px;
width: 80px;
background: #1299E6;
border: 1px solid #A0D9F9;
border-radius: 40px;
}
.range::-webkit-slider-thumb::before {
content: attr(data-val)
}
.range-infinite::before {
content: "∞";
}
.range input[type=range] {
border: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="range-div">
<input type="range" name="" id="" class="range">
</div>
I have a form which gets validated by javascript. In one of the if statements, in the final condition (when everything else has been validated) I would like to put my PHP script that updates SQL with ...
I have a form which gets validated by javascript. In one of the if statements, in the final condition (when everything else has been validated) I would like to put my PHP script that updates SQL with ...
I have some <List> connected component which passes a lot of attributes to <ListItem> components. It is getting to the point where a refactor is needed because too many attributes are ...
I have some <List> connected component which passes a lot of attributes to <ListItem> components. It is getting to the point where a refactor is needed because too many attributes are ...
I am planning on adding the javascript Notifications API functionality to a web app I am building. I took a look at the example from the MDN site: function spawnNotification(theBody, theIcon, ...
I am planning on adding the javascript Notifications API functionality to a web app I am building. I took a look at the example from the MDN site: function spawnNotification(theBody, theIcon, ...
I'm working with the import function, I wish use an import like for css, I mean "import './file.css'" then all the css attributes are diffused in the file. I have tried the same with ReactJS but it ...
I'm working with the import function, I wish use an import like for css, I mean "import './file.css'" then all the css attributes are diffused in the file. I have tried the same with ReactJS but it ...