Line 20: | Line 20: | ||
position:relative; | position:relative; | ||
} | } | ||
+ | /* Popup container - can be anything you want */ | ||
+ | .popup { | ||
+ | position: relative; | ||
+ | display: inline-block; | ||
+ | cursor: pointer; | ||
+ | -webkit-user-select: none; | ||
+ | -moz-user-select: none; | ||
+ | -ms-user-select: none; | ||
+ | user-select: none; | ||
+ | z-index:3; | ||
+ | } | ||
+ | #myPopup1 { | ||
+ | transform:translate(10px,50px); | ||
+ | } | ||
+ | |||
+ | #myPopup2 { | ||
+ | transform:translate(150px,50px); | ||
+ | } | ||
+ | |||
+ | #myPopup3 { | ||
+ | transform:translate(300px,50px); | ||
+ | } | ||
+ | |||
+ | /* The actual popup */ | ||
+ | .popup .popuptext { | ||
+ | visibility: hidden; | ||
+ | width: 200px; | ||
+ | background-color: #555; | ||
+ | color: #fff; | ||
+ | text-align: center; | ||
+ | border-radius: 10px; | ||
+ | padding: 10px 0; | ||
+ | position: relative; | ||
+ | bottom: 125%; | ||
+ | left: 50%; | ||
+ | margin-left: -50px; | ||
+ | } | ||
+ | |||
+ | /* Popup arrow */ | ||
+ | .popup .popuptext::after { | ||
+ | content: ""; | ||
+ | top: 100%; | ||
+ | left: 50%; | ||
+ | margin-left: -5px; | ||
+ | border-width: 5px; | ||
+ | border-style: solid; | ||
+ | border-color: #555 transparent transparent transparent; | ||
+ | } | ||
+ | |||
+ | #numbr1 | ||
+ | { | ||
+ | transform:translate(30%,100%); | ||
+ | width:10%; | ||
+ | opacity:0.5; | ||
+ | z_index:3; | ||
+ | } | ||
+ | |||
+ | #numbr2 | ||
+ | { | ||
+ | transform:translate(30%,100%) | ||
+ | width:50%; | ||
+ | opacity:0.5; | ||
+ | z_index:3; | ||
+ | } | ||
+ | |||
+ | #numbr3 | ||
+ | { | ||
+ | transform:translate(30%,30%); | ||
+ | width:10%; | ||
+ | opacity:0.5; | ||
+ | z_index:3; | ||
+ | } | ||
+ | |||
+ | .fond | ||
+ | { | ||
+ | background-image: url("boite.png"); | ||
+ | background-repeat:no-repeat; | ||
+ | background-position : center center; | ||
+ | } | ||
+ | |||
+ | /* Toggle this class - hide and show the popup */ | ||
+ | .popup .show { | ||
+ | visibility: visible; | ||
+ | -webkit-animation: fadeIn 1s; | ||
+ | animation: fadeIn 1s; | ||
+ | } | ||
+ | |||
+ | /* Add animation (fade in the popup) */ | ||
+ | @-webkit-keyframes fadeIn { | ||
+ | from {opacity: 0;} | ||
+ | to {opacity: 1;} | ||
+ | } | ||
+ | |||
+ | @keyframes fadeIn { | ||
+ | from {opacity: 0;} | ||
+ | to {opacity:1 ;} | ||
+ | |||
</style> | </style> | ||
Line 28: | Line 125: | ||
<h1> PROJECT </h1> | <h1> PROJECT </h1> | ||
</header> | </header> | ||
− | + | <div class="fond"> | |
+ | <div class="popup" onclick="myFunction1()"><img id="numbr1" src="b1.jpeg"> | ||
+ | <span class="popuptext" id="myPopup1">Le milieu Basique blablabla</span> | ||
+ | </div> | ||
+ | </div> | ||
+ | </body> | ||
+ | <script> | ||
+ | // When the user clicks on div, open the popup | ||
+ | function myFunction1() { | ||
+ | var popup = document.getElementById("myPopup1"); | ||
+ | popup.classList.toggle("show"); | ||
+ | } | ||
+ | function myFunction2() { | ||
+ | var popup = document.getElementById("myPopup2"); | ||
+ | popup.classList.toggle("show"); | ||
+ | } | ||
+ | |||
+ | function myFunction3() { | ||
+ | var popup = document.getElementById("myPopup3"); | ||
+ | popup.classList.toggle("show"); | ||
+ | } | ||
+ | </script> | ||
</html> | </html> |
Revision as of 11:59, 18 July 2017
PROJECT
Le milieu Basique blablabla