I'm not too familiar with coding for javascript, so I don't know how to properly write an if/else statement. The code below basically moves a div tag down the page when the button headerOp is clicked.
notice that you have to strip out the "px" from the returned margin-top otherwise its a string and numeric comparisons wont work. (if it gives you problems try wrapping it in parseInt($(ELEMENT).css("margin-top").replace("px", "")) )
Sorry if I'm really slow, but can you show me how I would implement this into my code? I tried this, but I have a syntax error in there somewhere.........
I want to check headerContent, so I replaced ELEMENT with that. Tell me if I'm wrong, but I also don't think I need the "else" if I make the check "<= 60" instead of ">=60" This would basically only perform the function if marginTop is less than 60px, right?
I'm not too familiar with coding for javascript...
Are you conscious that you are using a JQuery syntax, not the native JavaScript syntax? Do you know what is a javascript framework (like JQuery)? Do you know that JQuery is not the only framework (there are several important ones).
Whenever you have a problem regarding a framework, please, specify which is the framework you are working with. Don't let us guess.
Sorry........ I am aware that I am coding for JQuery, but I did warn you that I was inexperienced. And just because you are protected by the anonymity of the web doesn't mean you can be more rude to someone online that you would in person.....
Well then I apologize for the misunderstanding. But here is some food for thought.... as a moderator, a leader on this forum, people will be much more receptive to your suggestions if you find a less critical way to say them. After all, this is a help forum.
Well then I apologize for the misunderstanding. But here is some food for thought.... as a moderator, a leader on this forum, people will be much more receptive to your suggestions if you find a less critical way to say them. After all, this is a help forum.
I really don't understand what bothers you. I was not critical, I have only put some questions and emphasized some less knows issues. Case closed.
Now, regarding your problem. Have you studied the JQuery documentation?
Bookmarks