Kervtuza Posted January 3, 2013 Report Share Posted January 3, 2013 Hey Guys, I am looking for a little help on writing one of my first scripts. I currently have <script> $(document).ready(function(){ $("#nav_home").click(function(){ $("#content, #site_info").animate({ top:'0px', }); }); $("#nav_about").click(function(){ $("#content, #site_info").animate({ top:'-1070px', }); }); $("#nav_projects").click(function(){ $("#content, #site_info").animate({ top:'-1590px', }); }); $("#nav_contact").click(function(){ $("#content, #site_info").animate({ top:'-2650px', }); }); }); </script> I want add to the script a conditional statement that says if (#content left property = -1070px){ $("#branding").animate({ top:'-100px', }); }); The problem is I don't know how to access the css property of the unique id... Any ideas? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted January 3, 2013 Report Share Posted January 3, 2013 I would suggest using .position(): http://api.jquery.com/position/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.