Jump to content
Killersites Forums

Need Help With A Simple Javascript Statement


Recommended Posts

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?

Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...