I recently finished the UI for a volume slider and then published the code to my website. However, the slider design that shows up on the website is different than the one I had designed.
Why is this and how can I fix this?
Original:
Final (shown on website):
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
$(function() {
// var audioElement = $("<audio>");
function setVolume(myVolume) {
if (audioElement != undefined) {
audioElement.volume = myVolume;
}
}
$("#volume").slider({
min: 0,
max: 1,
value: 1,
step: 0.01,
range: "min",
slide: function(event, ui) {
setVolume(ui.value);
}
});
});
$("#player").hover(
function() {
$('.ui-slider-range-min').css("background-color", "#483EF1")
$('.ui-slider-handle').css("display", "block")
},
function() {
$('.ui-slider-range-min').css("background-color", "#B3B3B3")
$('.ui-slider-handle').css("display", "none")
}
);
/* audioUtilities */
.audioUtilitiesDiv {
display: inline-block;
/* background-color: darkblue; */
width: 350px;
height: 100%;
position: fixed;
right: 0px;
}
#player {
width: 140px;
height: 30px;
/* position: relative; */
/* margin: 0 auto; */
bottom: 40px;
/* background: black; */
position: fixed;
right: 15px;
}
/* #player:hover {
background: #483EF1;
} */
i {
position: absolute;
margin-top: -6px;
color: #666;
}
i.fa-volume-down {
margin-left: -8px;
}
i.fa-volume-up {
margin-right: -8px;
right: 0;
}
#volume {
position: absolute;
left: 24px;
margin: 0 auto;
height: 5px;
width: 100px;
background: #505050;
border-radius: 15px;
}
.ui-slider-range-min {
height: 5px;
width: 300px;
position: absolute;
background: #B3B3B3;
border: none;
border-radius: 10px;
outline: none;
}
/* .ui-slider-range-min:hover {
background: #483EF1;
} */
.ui-slider-handle {
width: 16px;
height: 16px;
border-radius: 20px;
background: #FFF;
position: absolute;
margin-left: -8px;
margin-top: -6px;
cursor: pointer;
outline: none;
display: none;
}
/* Volume slider */
<div class="audioUtilitiesDiv">
<div id="player">
<i class="fa fa-volume-down"></i>
<div id="volume"></div>
<!-- <i class="fa fa-volume-up"></i> -->
</div>
</div>
Update:
It seems like jquery ui file is not found I get this error in the console:
file://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css net::ERR_FILE_NOT_FOUND
(Do I have to do something in the terminal maybe? Install it?)