php - Animate right, or up not working -


i trying have box 2 options , want animate , fadeout left when click option 1 , animate , fadeout right when select option two. unfortunately, animates left , up, not right want. (nor animate bottom). can solve this.

$(document).ready(function () { $(".appimg2").one('click.appimg2', function() {     $('.appimg1, .appimg2').unbind('click');     $('#app1').animate({         right: "250px",         opacity:0     });     $("#app3").fadein("slow");     }); });  #app1{ position:absolute; width:250px; height:250px; z-index:10; top:50%; left:50%; margin:-150px 0 0 -150px; background:white; box-shadow: 0 0 1px 1px #888888; text-align:center; } 

i'm assuming it's how declare margins of #app1,2 , 3 cant figure out.

http://jsfiddle.net/7tgjc/

firstly you're better off showing html - in fiddle preferably.

i believe you're seeing intended , default behaviour of fade-in/animate. if want fadein/animate in different directions, could utilise jquery slide direction parameter jquery ui library.

<script> $('#examplediv').hide("slide", { direction: "right" }, function() {    //some code. }); </script> 

but indeed you're better off removing margins, see fiddle without margins: http://jsfiddle.net/smrcy/4/ animating right.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -