TheCarver
TheCarver

Reputation: 19713

JQuery Overlay - Change OnClick to OnMouseOver

I am using a jQuery overlay, like this one:

$("a[rel]").overlay({
    mask: '#EFEFEF',
    close: "a.closeOverlayBtn",
    closeOnClick: false
});

This works by clicking a link, like this one:

<a href="foo" class="bar" rel="#overlay1">baz</a>

How can I modify this to work by onmouseover instead of onclick?

Upvotes: 0

Views: 669

Answers (1)

Detect
Detect

Reputation: 2069

You could trigger the click event onmouseover.

$('a[rel]').mouseover(function(){
  $(this).trigger('click');
});

Upvotes: 2

Related Questions