Hmm thanks for the help! This help me understand more of how jquery works, just to keep update, I did the follow to workaround:
$("#artigos_listagem li:even").addClass('even'); $("#artigos_listagem li").mouseover(function(e){ $(this).css({ background: "#ffffaa" }); }); $("#artigos_listagem li").mouseout(function(e){ if ($(this).hasClass('even')) { $(this).css({ background: '#E7EDF1' }); } else { $(this).css({ background: '#ffffff' }); } }); but I'll use the toggle function, looks much better and smarter best regards! Maginot Júnior "the game of life" LPIC - CCNA - ¿Designer? On Tue, Jan 13, 2009 at 2:48 AM, seasoup <seas...@gmail.com> wrote: > > untested, but the point is you can pass an object as the second > parameter of the .bind() function. Doesn't work with the shortcuts as > far as I know. Then, you can access those object in the event.data > property of the event passed into the function. > > $("#artigos_listagem li").mouseover(function(e){ > var orgBg = $(this).css('background'); > $(this).css({ > background: "#ffffaa" > }); > }); > $("#artigos_listagem li").bind('mouseout', { 'orgBg' : > orgBg}, function(e){ > $(this).css({ > background: e.data.orgBg > }); > }); > > I'm also not quite sure what you are attempting... it looks like those > li are getting a mouseover/mouseout function that sets the background > to one color when rolling over and to another when rolling off. If > that is the case: > > $("#artigos_listagem li").toggle(function() { > $(this).css({'background':'#ffffaa'}); > }, > function() { > $(this).css({'background':'#aaffff'}); > }) > > If the colors aren't known beforehand, since you are setting it > dynamically on li's with different background colors then you could > save the current background color as a custom attribute using .attr() > or as data on the object using .data() > > http://docs.jquery.com/Internals/jQuery.data >