Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <link rel="stylesheet" type="text/css" href="style2.css">
</head>
<body>
  <div class="grid">
<div class="com">Zone Commerciale</div>
            <div class="bio">Zone BIO</div>
<div class="adm">Zone Administrative</div>
<div class="cul">Zone Culturelle</div>
<img class="fond" src="http://dupontcours.free.fr/IMG/paris.PNG" alt="">
    </div>
    <script src="javascript2.js"></script>
</body>
</html>
 
Array.from(document.querySelectorAll('.grid div'),el => {
  
const randomNumber = (min, max) => Math.floor(Math.random() * (max - min + 1) + min);
const randomByte = () => randomNumber(0, 255)
const randomPercent = () => (randomNumber(5, 50) * 0.01).toFixed(2)
const randomCssRgba = () => `rgba(${[randomByte(), randomByte(), randomByte(), randomPercent()].join(',')})`
  
let c = randomCssRgba();
el.style.color=el.style.background = c;
  el.addEventListener("mouseover", function( event ) {   
    // highlight the mouseover target
    event.target.style.color = "red";
    // reset the color after a short delay
    setTimeout(function() {
      event.target.style.color = c;
    }, 5000);
  }, false);}
          );
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
PaulineSpingapro
0viewers