[Javascript] Combining Behaviors/Effects

Tedd Sperling tedd at sperling.com
Tue Oct 4 16:45:49 CDT 2011


_____________________
tedd at sperling.com
http://sperling.com


On Oct 4, 2011, at 5:15 PM, Paul Novitski wrote:

> At 10/4/2011 09:06 AM, Tedd Sperling wrote:
>> Given this example:
>> 
>> http://www.webbytedd.com/test/
>> 
>> As explained in the example, can these two behaviors/effects be combined?
>> 
>> In short, I would like to create a single "fade-cycle image replacement" technique. Both behaviors use the background image, but I can't seem to master the problem just yet. My current code and images are there for your review.
> 
> 
> Hi Tedd,
> 
> This shouldn't be difficult. The fade-cycle routine uses the array gblImg() to point to the images it toggles between. I'd try giving it two such arrays, e.g. gblImg_normal() and gblImg_hover(), set gblImg equal to gblImg_normal, and on hover set gblImg equal to gblImg_hover.
> 
> Regards,
> 
> Paul

Paul:

I had not thought of that. I was thinking that one image change was caused by css pseudo-classes background position change and the other by changing the background url (image) style via javascript. I was trying to get both styling aspects together in one javascript style change. I know, that makes about as much sense as my results did, which didn't work.

Thanks,

tedd



More information about the Javascript mailing list