Created
May 23, 2011 01:09
-
-
Save tomykaira/986073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="../../jquery-1.5.1.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.ui.draggable.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.core.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.scale.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.blind.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.bounce.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.clip.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.drop.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.explode.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.fade.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.fold.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.highlight.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.pulsate.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.shake.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.slide.js"></script> | |
<script type="text/javascript" src="../../ui/jquery.effects.transfer.js"></script> | |
<script type="text/javascript"> | |
// var effect = "drop" | |
var i = 0; | |
$(document).ready( function() { | |
$("#wid").click(function(){ | |
$.each( $.effects.effect, function( effect ) { | |
if (effect === "transfer") { | |
return; | |
} | |
setTimeout( function() { | |
console.log(effect); | |
$(".wid").hide(effect, {}, 1000).show(effect) | |
.hide(effect, {direction: "right"}, 1000).show(effect, {direction: "right"}) | |
.hide(effect, {direction: "up"}, 1000).show(effect, {direction: "up"}) | |
.hide(effect, {direction: "down"}, 1000).show(effect, {direction: "down"}); | |
}, 5000); | |
i ++; | |
}) | |
}); | |
$("#hei").click(function(){ | |
$(".hei") | |
.hide(effect, {}, 1000).show(effect) | |
.hide(effect, {direction: "right"}, 1000).show(effect, {direction: "right"}) | |
.hide(effect, {direction: "up"}, 1000).show(effect, {direction: "up"}) | |
.hide(effect, {direction: "down"}, 1000).show(effect, {direction: "down"}); | |
}); | |
}); | |
</script> | |
<style type="text/css" media="screen"> | |
.obj1 { | |
height: 200px; | |
width: 100%; | |
} | |
.move { | |
background: red; | |
border: 30px dashed green; | |
} | |
.rel { position: relative; left: 300px; top: 30px } | |
.wid { height: 100px; } | |
.obj2 { | |
width: 50%; | |
} | |
.obj3 { | |
width: 631px; | |
} | |
.hei { width: 631px; } | |
.obj4 { | |
height: 50%; | |
} | |
.obj5 { | |
height: 100px; | |
} | |
</style> | |
</head> | |
<body> | |
Specify width by %; | |
<button id="wid">Click</button> | |
<div class="obj1"> | |
<div class="obj2 wid rel move">Wrong</div> | |
</div> | |
<div class="obj1"> | |
<div class="obj3 wid rel move">Correct</div> | |
</div> | |
Specify height by %; | |
<button id="hei">Click</button> | |
<div class="obj1"> | |
<div class="obj4 hei rel move">Wrong</div> | |
</div> | |
<div class="obj1"> | |
<div class="obj5 hei rel move">Correct</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment