Jump to content

Recommended Posts

Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...