Skip to content

Commit

Permalink
Add testcase for .fade() to the Fx test
Browse files Browse the repository at this point in the history
  • Loading branch information
Arian committed Feb 9, 2012
1 parent 63d61b6 commit a1330c5
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions Specs/1.4client/Fx/Fx.html
Expand Up @@ -77,6 +77,12 @@
width: 300px;
}

.wrapper {
width: 500px;
height: 300px;
background: #eee;
}

</style>

</head>
Expand Down Expand Up @@ -190,10 +196,8 @@ <h1>Fx.Morph with % as unit</h1>
<a href="#" id="units-fx-morph-link">morph</a>
</p>

<div style="width: 500px; height: 300px; background: #eee;">

<div class="wrapper">
<div id="units-fx-morph" class="box"></div>

</div>

<script>
Expand All @@ -219,6 +223,40 @@ <h1>Fx.Morph with % as unit</h1>

</script>

<h1>.fade</h1>

<p>
<a href="#" id="fade-link">fade</a><br>
<span id="fade-opacity"></span>
</p>

<div class="wrapper">
<div id="fade" class="box"></div>
<h1 id="fade2" class="box">test</h1>
</div>

<script>
var fadeToggle = 1;
var fade = $('fade').set('tween', {
onStart: function(){
$('fade-opacity').set('text', fade.getStyle('opacity'))
.appendText(' ' + fade.getStyle('visibility'));
},
onComplete: function(){
$('fade-opacity').set('text', fade.getStyle('opacity'))
.appendText(' ' + fade.getStyle('visibility'));
}
});
fade.fade('hide');
var fade2 = $('fade2');
$('fade-link').addEvent('click', function(event){
event.preventDefault();
var to = fadeToggle++ % 5 / 4;
fade.fade(to == 1 ? 'in' : (to == 0 ? 'out' : to));
fade2.fade('hide');
fade2.fade('in');
});
</script>

</div>

Expand Down

0 comments on commit a1330c5

Please sign in to comment.