[jQuery] Re: hover and className

2007-12-06 Thread Glen Lipka
Well it sounds like you are in a better place than last week. :) Let us know if there is anything else we can help with. Best, Glen On Dec 5, 2007 7:47 PM, DaveG [EMAIL PROTECTED] wrote: Glen Lipka wrote: Let's start at the beginning. Let's assume (work with me here) that

[jQuery] Re: hover and className

2007-12-06 Thread DaveG
Glen Lipka wrote: Well it sounds like you are in a better place than last week. :) Absolutely -- thanks for your help.

[jQuery] Re: hover and className

2007-12-05 Thread David Serduke
Sorry to butt in but I was wondering if this was a weird jQuery bug so looked in to it. What I found was it appears the way you are changing the className is the problem. When I took out that part and replaced it with addClass and removeClass it seemed better. I took some liberties with your

[jQuery] Re: hover and className

2007-12-05 Thread DaveG
David Serduke wrote: Sorry to butt in but I was wondering if this was a weird jQuery bug so looked in to it. What I found was it appears the way you are changing the className is the problem. I came to the same conclusion; it looks like replacing the class name causes the hover to re-fire.

[jQuery] Re: hover and className

2007-12-05 Thread DaveG
Glen Lipka wrote: Let's start at the beginning. Let's assume (work with me here) that autogeneration of sprites and css is the path to ruin. Actually, I don't agree with this statement. Auto-generation get you the sprite and positioning css, which is nice, and is useful. One of the primary

[jQuery] Re: hover and className

2007-12-04 Thread Glen Lipka
In general, there are better ways of doing this. One way is with a sprite. (Background or foreground) http://learningtheworld.eu/2007/foreground-sprites/ Browsers are very fast at CSS, and not nearly as fast at replacing graphics. Many browsers show a flicker. If you use a sprite then it works

[jQuery] Re: hover and className

2007-12-04 Thread DaveG
Glen Lipka wrote: One way is with a sprite. (Background or foreground) http://learningtheworld.eu/2007/foreground-sprites/ Actually I'm using sprites, that's why I'm switching from css :hover to this :) We've gone beyond the 'normal' approach of combining over/out images into a single

[jQuery] Re: hover and className

2007-12-04 Thread Glen Lipka
Do you have a page that has the example? Also, I use jQuery with sprites in multiple methods here. Some use a very powerful matrix approach, which has really clean CSS. http://www.commadot.com/jquery/sprites/ Glen On Dec 4, 2007 5:02 PM, DaveG [EMAIL PROTECTED] wrote: Glen Lipka wrote:

[jQuery] Re: hover and className

2007-12-04 Thread DaveG
Glen Lipka wrote: Do you have a page that has the example? If you mean an example of the flickering problem, then I'll put one up. Also, I use jQuery with sprites in multiple methods here. Some use a very powerful matrix approach, which has really clean CSS. We considered the matrix idea,

[jQuery] Re: hover and className

2007-12-04 Thread DaveG
Do you have a page that has the example? If you mean an example of the flickering problem, then I'll put one up. Test: http://solidgone.com/jquery/hover-test.html

[jQuery] Re: hover and className

2007-12-04 Thread DaveG
A slightly better working version: jQuery(document).ready(function() { jQuery([EMAIL PROTECTED]'sprite-hover-']).hover( function(){ jQuery(this).addClass( this.className.replace(/sprite-hover-(\w+)-off/gi, 'sprite-hover-$1-on') ); // jQuery(this).attr('class',

[jQuery] Re: hover and className

2007-12-04 Thread Glen Lipka
Let's slow down a little. I think this might be much easier than you imagine. Let's go over the requirements. 1. You have different shaped buttons. 2. Each button has a hover. 3. You want to add all the hover handlers using jQuery. Does this sound correct? Add to this list, but keep it

[jQuery] Re: hover and className

2007-12-04 Thread DaveG
Hey, if you can help simplify this, great! 1. Different size images. 2. *Some* images have 'hover' effects. 3. Classes within the sprite are named the same as the originating image name. 4. When images are added/changed/removed and the sprite is regenerated, need to be able to copy/paste the

[jQuery] Re: hover and className

2007-12-04 Thread Glen Lipka
Let's start at the beginning. Let's assume (work with me here) that autogeneration of sprites and css is the path to ruin. Let's assume 100 images should be manageable in a very easy way. (When you add new images it should take under 3 minutes to update things) Here a beginning...