1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Première ébauche du site DAC</title>
<script type="text/javascript">
function $(id){
return document.getElementById(id);
}
function opacityin(id, opacStart, opacEnd, millisec) {
if($(id).tempo){clearTimeout($(id).tempo);}
var $(id).speed = Math.round(millisec / 100);
var $(id).timer = 0;
if(opacStart > opacEnd) {
for(i = opacStart; i >= opacEnd; i--) {
$(id).tempo = setTimeout("changeOpacin(" + i + ",'" + id + "')",(timer * speed));
$(id).timer++;
}
}
else if(opacStart < opacEnd) {
for(i = opacStart; i <= opacEnd; i++) {
$(id).tempo = setTimeout("changeOpacin(" + i + ",'" + id + "')",(timer * speed));
$(id).timer++;
}
}
}
function changeOpacin(opacity, id) {
var object = document.getElementById(id).style;
object.opacity = (opacity * 100);
object.MozOpacity = (opacity * 100);
object.KhtmlOpacity = (opacity * 100);
object.filter = "alpha(opacity=" + opacity + ")";
}
function opacityout(id, opacStart, opacEnd, millisec) {
if($(id).tempo){clearTimeout($(id).tempo);}
var $(id).speed = Math.round(millisec / 100);
var $(id).timer = 0;
if(opacStart > opacEnd) {
for(i = opacStart; i >= opacEnd; i--) {
$(id).tempo = setTimeout("changeOpacout(" + i + ",'" + id + "')",(timer * speed));
$(id).timer++;
}
}
else if(opacStart < opacEnd) {
for(i = opacStart; i <= opacEnd; i++) {
$(id).tempo = setTimeout("changeOpacout(" + i + ",'" + id + "')",(timer * speed));
$(id).timer++;
}
}
}
function changeOpacout(opacity, id) {
var object = document.getElementById(id).style;
object.opacity = (opacity / 100);
object.MozOpacity = (opacity / 100);
object.KhtmlOpacity = (opacity / 100);
object.filter = "alpha(opacity=" + opacity + ")";
}
</script>
<head>
<body>
<div style="width:300px;height:30px;background-color:#e411a6;position:relative;" onmouseover="opacityin('color', 0, 100, 500);" onmouseout="opacityout('color', 100, 0, 500);">
<div id="color" style="width:300px;height:30px;background-color:black;position:relative;z-index:1;filter:alpha(opacity=0);-moz-opacity:0.0;opacity:0.0;-khtml-opacity:0.0;">
</div>
</div>
<div style="width:300px;height:30px;background-color:#e411a6;position:relative;" onmouseover="opacityin('color2', 0, 100, 500);" onmouseout="opacityout('color2', 100, 0, 500);">
<div id="color2" style="width:300px;height:30px;background-color:black;position:relative;z-index:1;filter:alpha(opacity=0);-moz-opacity:0.0;opacity:0.0;-khtml-opacity:0.0;">
</div>
</div>
<div style="width:300px;height:30px;background-color:#e411a6;position:relative;" onmouseover="opacityin('color3', 0, 100, 500);" onmouseout="opacityout('color3', 100, 0, 500);">
<div id="color3" style="width:300px;height:30px;background-color:black;position:relative;z-index:1;filter:alpha(opacity=0);-moz-opacity:0.0;opacity:0.0;-khtml-opacity:0.0;">
</div>
</div>
</body>
</html> |
Partager