Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8327249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:02:42+00:00 2026-06-09T01:02:42+00:00

I am using fancybox as my modal window. I was able to trigger the

  • 0

I am using fancybox as my modal window. I was able to trigger the modal window to open on hover, but I also want it to close the window when the link is not being hovered over (out of focus?).

$("a.mini-view").fancybox().hover(function() {
  $(this).click();
});

Any help is appreciated.

I added the mouseout, I am not good at js, so refactoring the following would be helpful:

$(document).ready(function() {

  $('a.mini-view').mouseout(function () {
    $.fancybox.close();
  });

  $("a.mini-view").fancybox().hover(function() {
    $(this).click();
  });

  $("a.mini-view").fancybox({
    'overlayShow' : false,
    'autoScale'   : true
  });

});

If I go from one link directly to another, without pausing between the two, it doesn’t work

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:02:44+00:00Added an answer on June 9, 2026 at 1:02 am

    The main problem with triggering events using .hover() or other mouse in/out jQuery methods is called bubbling.

    For your particular issue, your best bet is using the jQuery plugin hoverIntent. If you visit their website, they have a good example about what dealing with bubbled events mean.

    After you loaded the hoverIntent js file, you can create two functions to open/close fancybox that will be called by hoverIntent as callbacks :

    function openFancybox(){
     $(this).trigger("click");
    }
    function closeFancybox(){
     $.fancybox.close();
    }
    

    …. then your hoverIntent custom script :

    $(".mini-view").hoverIntent({
     sensitivity: 7,
     interval:500,
     timeout:0,
     over: openFancybox,
     out: closeFancybox 
    }); // hoverIntent
    

    (see documentation to fine-tune your settings)

    …last, your fancybox custom script will simply look like:

    $(".mini-view").fancybox({
     'overlayShow' : false,
     'autoScale'   : true
    }); // fancybox
    

    SEE WORKING DEMO and feel free to explore the source code.

    SIDE NOTES:

    • To simplify your code, you could actually apply both plugins in a single step to the same selector :

       $(".mini-view")
       .fancybox({
        'overlayShow' : false,
        'autoScale'   : true
       })
       .hoverIntent({
        sensitivity: 7,
        interval:500,
        timeout:0,
        over: openFancybox,
        out: closeFancybox 
       });
      
    • Because the options you used in your code, I assumed you were using fancybox v1.3.4.


    UPDATE [March 2015] :

    DEMO using the latest versions of Fancybox (v2.1.5) and hoverIntent (v1.8.0)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Fancybox. When the following link is clicked the modal window opens
Using Fancybox version 2 supplied by http://fancyapps.com/fancybox/#support I want to open a fancybox from
I have a form in a modal iframe window that i create using fancybox.
im using fancybox from: http://fancyapps.com/fancybox/ And the scroll pane is not working correctly and
Fist time using fancybox and it's not going so well.. starting to wish I
I'm using Fancybox 1.3.4 with ASP.NET MVC 3. I have following link : <a
I am using the fancybox.I want to display the image gallery using the galleria
I'm using Fancybox to display a popup window, set as type: 'ajax' so I
I am using fancybox to display a gallery of pictures. But I wanted to
I'm using FancyBox to display YouTube videos (using the YouTube embed link) with Fancy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.