Kervtuza Posted January 3, 2013 Report 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?
falkencreative Posted January 3, 2013 Report Posted January 3, 2013 I would suggest using .position(): http://api.jquery.com/position/
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now