I am setting up an HTML 5 range element and looking to enhance the user experience. Specifically, I want to implement a feature where when the user hovers over the range, the height and width of the thumb should increase to 12 pixels.
CSS
.myrange::-webkit-slider-thumb{
position:relative;
top:-5px;
appearance:none;
-webkit-appearance:none;
-webkit-transition: width 2s, height 4s;
transition: width 2s, height 4s;
border-radius:50px;
background-color:rgb(9,90,0);
border:0;
cursor:pointer;
visibility:hidden;
}
JavaScript
var styleElement = $("<style>", {"type": "text/css"}).appendTo("head");
$('.myrange').hover(function(){
styleElement.text('.myrange::-webkit-slider-thumb{height:12px; width:12px;}');
});