Here are two options:
$('.contentBox, .referencesImage').hover(fn, fn);

$('.contentBox').add('.referencesImage').hover(fn, fn);

- Richard

On Thu, Oct 15, 2009 at 5:06 AM, Dennis Madsen <[email protected]> wrote:

>
> I would like to do something like:
>
>        $(".contentBox").$(".referencesImage").hover(function(event){
>                 ..do something
>        },function(event){
>                ..do something
>        });
>
> Where the hover-function is both for both element sets.
>
>
> On 15 Okt., 10:48, Dennis Madsen <[email protected]> wrote:
> > I have two element sets: $(".contentBox") and $(".referencesImage").
> > How can I join the elements in this sets? I would like to join the
> > sets, since I'm adding the exact same hover function on both element
> > sets.
> >
> >         $(".contentBox").hover(function(event){
> >                 ..do something
> >         },function(event){
> >                 ..do something
> >         });
> >
> >         $(".referencesImage").hover(function(event){
> >                 ..do something
> >         },function(event){
> >                 ..do something
> >         });
>

Reply via email to