Let's take a quick look at three more features in Spry 1.4. First lets take a look at remove and addClassName. These two functions will either remove, or apply, a CSS style to an element. So consider this element:
<div id="test">This is the test content that will be changing.</div>
To apply a CSS style to this element, you can use this code:
Obviously removeClassName will remove the item.
The last new function I'll discuss is getNodeText(). As you can probably guess, it returns the text inside an element. Using the same div above, the following code:
var str = Spry.Utils.getNodeText($('test'));
will set str equal to: This is the test content that will be changing.
For an example of all three, check out this demo Be sure to view source.
Trust me - my JS was rusty as well. AJAX is bringing it back.
Shameless jQuery plug
Y'know, I really disliked the initial releases of Spry... the stuff it made easy wasn't really relevant to me, and required some ugly HTML.
But now they're getting into some things I can really use, and I'm slightly excited.
I am having trouble with a condition (www.sigmanuepsilondelta.com.... This is only part of a site that is for people to use to predict the bowl games, and I want to make it so that if their prediction is right, the text is green, and if not red. Any suggestions on how to go about doing this?
You want to use conditionals. Here is a slightly older example of that:
It is pretty simply in Spry.