css - Change multiple background-images with jQuery -
in css page, have code:
header { background:url('afbeeldingen/r.png'),url('afbeeldingen/black.jpg'); background-position: 50% 33%, left top; background-repeat: no-repeat, no-repeat; background-size:26%,960px 130px; margin-left:auto; margin-right:auto; }
now in html page, want use jquery change first image when hover navigation bar. can please me?
use class header navigation button wherever want work
.header { background:url('afbeeldingen/r.png'),url('afbeeldingen/black.jpg'); background-position: 50% 33%, left top; background-repeat: no-repeat, no-repeat; background-size:26%,960px 130px; margin-left:auto; margin-right:auto; } <script> $(".header").hover(function(){ $(this).css("background","url('afbeeldingen/black.jpg'),url('afbeeldingen/anotherhoverimage.jpg')"); }); $(".header").mouseout(function(){ $(this).css("background","url('afbeeldingen/r.png'),url('afbeeldingen/black.jpg')"); }); </script>
Comments
Post a Comment