Fred Furunkelstein 2012: Wie Transition auslösen?

Beitrag lesen

Ist das Dein Problem?

<html>  
<head>  
<style type="text/css">  
  
.balken_yellow_preload {  
        height:20px;  
        width:20px;  
        overflow:hidden;  
        background: rgb(255,255,0);  
        transition: width .5s linear;  
        -moz-transition: width .5s linear; /* Firefox 4 */  
        -webkit-transition: width .5s linear; /* Safari and Chrome */  
        -o-transition: width .5s linear; /* Opera */  
}  
  
/* #balken_yellow:hover {  
        width:140px;  
}*/  
  
  
.balken_yellow_load {  
        height:20px;  
        width:140px;  
        overflow:hidden;  
        background: rgb(255,255,0);  
        transition: width .5s linear;  
        -moz-transition: width .5s linear; /* Firefox 4 */  
        -webkit-transition: width .5s linear; /* Safari and Chrome */  
        -o-transition: width .5s linear; /* Opera */  
}  
  
</style>  
</head>  
<body>  
  
<div id="balken_yellow" class="balken_yellow_preload" onmouseover="this.style.width='140px'" onmouseout="this.style.width='10px'">Balken</div>  
</body>  
<script type="text/javascript">  
//document.getElementById('balken_yellow').style.width='140px';  
// (geht im FF 16 nur ohne Transition)  
  
//document.getElementById('balken_yellow').setAttribute('class','balken_yellow_load');  
// (geht im FF 16 nur ohne Transition)  
  
</script>  
</html>