WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
[resolved] Possible to see enlarged photos with mouseover instead of click? (7 posts)

  1. joadard
    Member
    Posted 5 months ago #

    I love the Easy FancyBox plugin - is it possible to modify the code anywhere so that it is triggered on a mouseover instead of an onclick?

    Thank you!!!!

    https://wordpress.org/plugins/easy-fancybox/

  2. RavanH
    Member
    Plugin Author

    Posted 5 months ago #

    Yes it is possible but modifying plugin code will mean you cannot upgrade anymore. Unless you are willing to apply the modifications after each update...

    Also, I'd advise against this kind of on mouse-over behaviour. It will very likely annoy you visitors too much. For example: on a site where the menu is on the left a visitor wants to navigate to another page via that menu so he moves his mouse in the direction of the menu but passes a thumbnail. Then an unexpected lightbox popup will prevent him from reaching the menu. He'll have to close the box first and then move from the top right (where the close button is) back to the menu on the left again, passing again the thumbnail. And again the lightbox will prevent him from reaching the menu.

    This does not have to happen many times before any visitor will leave your site to never come back!

  3. RavanH
    Member
    Plugin Author

    Posted 5 months ago #

    Anyway... You can do what you want without modifying the plugin. Put this in your themes footer.php template file after the <?php wp_footer(); ?> call and before the closing </body> tag:

    <script type="text/javascript">
    jQuery(document).on('ready post-load', function() {
      jQuery('.fancybox').mouseenter( function() {
        jQuery(this).trigger('click');
      } );
    } );
    </script>
  4. joadard
    Member
    Posted 5 months ago #

    Hello -

    Thank you very much. This particular site has a series of galleries for a professional photographer and this is how he would like it set up :) I understand the 'annoyance' factor - but it hasn't been an issue for him!

    I added the code - but it doesn't seem to load the images on the mouseover :(

    Any thoughts?

  5. RavanH
    Member
    Plugin Author

    Posted 5 months ago #

    Ah yes. What the client wants, the client gets ;)

    Can you share a link so I can do some debugging?

  6. joadard
    Member
    Posted 5 months ago #

    Hi -

    Thank you - davidspielman.com

    Thanks again!

  7. RavanH
    Member
    Plugin Author

    Posted 4 months ago #

    Hi joadard, please read carefully:

    ... Put this in your themes footer.php template file after the <?php wp_footer(); ?> call and before the closing </body> tag:
    ...

    Currently it is places above the <?php wp_footer(); ?> call.

Reply

You must log in to post.

About this Plugin

About this Topic