tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <fzli...@omnytex.com>
Subject Re: Reducing network traffic for rollover images
Date Sat, 02 Oct 2004 17:49:59 GMT
I really think this is a case where we might be trying to hard to be 
innovative... Just do the typical "two versions of an image and some 
scripting" approach.  Sure, slightly less maintainable, and yes, not 
quite as elegant code-wise, but it's a proven method that works across 
just about any browser (with JS enabled of course, but it degrades 
nicely to just the single normal state image, so no harm there).

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

Robert Koberg wrote:
> Robert Hunt wrote:
> 
>> To clarify:
>>
>> Watching the Tomcat access log and using permutations of CSS and the
>> FrankZ/jscript-caching-strategy to achieve the rollover effects, I've 
>> found
>> that the background image is requested:
>>
>>                IExplore 6.0            Netscape 7.2
>>               -----------------      --------------
>> CSS        each mouseover       once per page(1)
>>
>> JS           once per page(2)      once per page(2)
>>               each mouseover
>>
>>
>> (1) upon first hover/mouseover
>> (2) when the jscript executes
>>
>>
> 
> I have been hoping someone would offer some innovative solution, but 
> there really isn't one...
> 
> You have to perform some ugly hack. Check http://alistapart.com for some 
> solutions.
> 
> For example, you could provide the image with both (3?) states and 
> adjust the margin to show the correct state:
> 
> <a
>   href="boo"
>   class="hoverLink normal"
>   onmouseover="this.className='hoverLink hover'"
>   onmouseout="this.className='hoverLink normal'">boo</a>
> 
> With the image looking like:
> -----------------
> |  normal state | 30px in ht
> -----------------
> |  hover state  | 30px in ht
> -----------------
> 
> .hoverLink {
> background: url(images/states.gif);
> }
> 
> .normal {
> margin-top: 0px;
> }
> 
> .hover {
> margin-top: -30px;
> }
> 
> something like that... :(
> 
> best,
> -Rob
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message