Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // LUNDI
- var allOptionsL = document.querySelectorAll('#sLundi > option') //
- for (var i = 0; i < allOptionsL.length; i++) {
- allOptionsL[i].addEventListener('mouseover', highlightL);
- }
- function highlightL() {
- for (var i = 0; i < allOptionsL.length; i++) {
- allOptionsL[i].style.backgroundColor = ""; //
- }
- this.style.backgroundColor = "lightgray";
- }
- // MARDI
- var allOptionsM = document.querySelectorAll('#sMardi > option') //
- for (var i = 0; i < allOptionsM.length; i++) {
- allOptionsM[i].addEventListener('mouseover', highlightM);
- }
- function highlightM() {
- for (var i = 0; i < allOptionsM.length; i++) {
- allOptionsM[i].style.backgroundColor = ""; //
- }
- this.style.backgroundColor = "lightgray";
- }
- // MERCREDI
- var allOptionsMer = document.querySelectorAll('#sMercredi > option') //
- for (var i = 0; i < allOptionsMer.length; i++) {
- allOptionsMer[i].addEventListener('mouseover', highlightMer);
- }
- function highlightMer() {
- for (var i = 0; i < allOptionsMer.length; i++) {
- allOptionsMer[i].style.backgroundColor = ""; //
- }
- this.style.backgroundColor = "lightgray";
- }
- // JEUDI
- var allOptionsJ = document.querySelectorAll('#sJeudi > option') //
- for (var i = 0; i < allOptionsJ.length; i++) {
- allOptionsJ[i].addEventListener('mouseover', highlightJ);
- }
- function highlightJ() {
- for (var i = 0; i < allOptionsJ.length; i++) {
- allOptionsJ[i].style.backgroundColor = "";
- }
- this.style.backgroundColor = "lightgray";
- }
- //VENDREDI
- var allOptionsV = document.querySelectorAll('#sVendredi > option')
- for (var i = 0; i < allOptionsV.length; i++) {
- allOptionsV[i].addEventListener('mouseover', highlightV);
- }
- function highlightV() {
- for (var i = 0; i < allOptionsV.length; i++) {
- allOptionsV[i].style.backgroundColor = "";
- }
- this.style.backgroundColor = "lightgray";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement