i have a div element with Fx.styles effect
when mouseover : width is 300px
and mouseleave : this width is 100px .
Now, when i do mouseover , width run from 200px to 300px,
But when width run to 250px , i do mouseleave and i think width will run from 250px to 100px.
My think is wrong , width from 200px to 300px then back to 100px.
How to my think come TRUE :D
<div id="element" style="width:200px;">
Content content content
</div>
<script>
var myEffects = new Fx.Styles('element',{
unit: 'px',
duration: 400,
});
$('element').addEvents({
'mouseover' : function(e){
new Event(e).stop();
myEffects.start({
'width': 300
});
},
'mouseleave' : function(e){
new Event(e).stop();
myEffects.start({
'width': 100
});
}
});
</script>