1 Replies - 5281 Views - Last Post: 09 July 2011 - 09:46 AM

#1 Camerosaurus Rex  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 65
  • Joined: 06-June 11

first time jQuery headache...

Posted 07 July 2011 - 01:15 PM

Hi guys,

I'd like to try and learn this stuff myself (and I should have already by now...) However it seems that I have a client wanting some last-minute esthetics and she won't take later deadline. She wants some large divs to fade in/out and I've never used jQuery before. Can anyone see any problems because this comp is a very crappy replacement while my main one is being fixed - it took me 20+ minutes to make this post...


			function lightmeup (nodez) {
				if (nodez == 'fb') {
					document.getElementById('one').animate(color: '#888', 500);
				}
				else if (nodez == 'twttr') {
					document.getElementById('two').animate(color: '#888', 500);
				}
				else {
					document.getElementById('three').animate(color: '#888', 500);
				}
			}
			function lightmeoff (nodez) {
				if (nodez == 'fb') {
					document.getElementById('one').animate(color: '#555', 500);
				}
				else if (nodez == 'twttr') {
					document.getElementById('two').animate(color: '#555', 500);
				}
				else {
					document.getElementById('three').animate(color: '#888', 500);
				}
			}



The code to fade the divs....


<script type="text/javascrpt" src="jquery.min.js"></script>




The code to find the jQuery library (which is there..)

I won't be able to respond until tomorrow, when I have my comp back, so please only offer answers until then.

Thanks,
Rex

Is This A Good Question/Topic? 0
  • +

Replies To: first time jQuery headache...

#2 japanir  Icon User is offline

  • jaVanir
  • member icon

Reputation: 1011
  • View blog
  • Posts: 3,025
  • Joined: 20-August 09

Re: first time jQuery headache...

Posted 09 July 2011 - 09:46 AM

Just a note, why use getElementById if you use JQuery, you can use
$('#id').animate(..);

Anyways, the animate function is missing a "{}".
should be:
document.getElementById('three').animate({color: '#888'}, 500);

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1