javascript ignores format modifying instruction
Hi. All I want to do is fade some text in and out via the opacity attribute, and change the text when it hits zero. My script changes the text on time, but ignores the formatting effects. I'm not worried at this stage about the else statement in the startFadeEffect() function. I just want the fade effect to work here the way it should. You guys are always helpful, so thanks in advance.
Code:
<!DOCTYPE html> |
Am I being ignored because none can help, or because I've overlooked something grossly obvious?
|
Why aren't you using jQuery? The effect you want is part of its standard library.
http://api.jquery.com/fadeOut/ |
Quote:
For the most part, all this is new to me. So when I hear things like jQuery in the midst of other jargon, I often can't help but overlook it, if I'm to accomplish what I want before I reach 105 years of age. Most of you guys (even those calling themselves newbies) are somewhat well versed in technical computing. Also, I often like to try this sort of thing, even though I may be reinventing a duck. Thanks again! |
I should also point out that one of the reasons Javascript frameworks exist is to handle portability issues between browsers. With jQuery, therefore, you will not need to test whether the user is running Internet Explorer. You just write code and it will work in both Firefox and IE.
|
Quote:
|
You load it with a script tag. "script src="
More information is on its homepage, on huge numbers of other sites (hint: search stackoverflow.com for "jquery tutorial video"), and in bookstores ("jQuery In Action" is a recommended book). Code:
// I have NOT tested this. But it would be something like this... |
Quote:
|
Quote:
However, you'll have to be more specific about what you mean by "items that aren't included in that library." DOM manipulation and AJAX functionality are both very complete, for example. The only things that aren't included are the new features in HTML 5 (e.g. controlling embedded audio or drawing on the canvas). |
Quote:
Quote:
|
Quote:
Also, you don't need the "type=text/javascript" attribute if you're using the HTML 5 doctype (which you are). |
Quote:
Quote:
|
Quote:
|
Anyway, here's the jQuery version (tested, this time):
Code:
<!DOCTYPE html> Quote:
Quote:
|
Okay, thanks for all your help Dugan. Now to study up on jQuery (so many books, so little time).
|
All times are GMT -5. The time now is 06:36 AM. |