-
AuthorPosts
-
September 4, 2023 at 2:47 pm #1418033
Hi Enfold-team,
I have a question about the ‘Image with hotspots’ element. There are three options for displaying tooltips: on mouseover, always, or ‘show on mouseover, hide on click.’ In the latter case, however, you must click directly on the respective hotspot to close the tooltip. Is it possible to make it so that you can click anywhere on the page to close the tooltip?
Thanks in advance!
Ita
September 5, 2023 at 7:48 am #1418117Hey Frans,
Thank you for the inquiry.
This is possible but you have modify one of the script files directly. Please check the following threads for more info.
// https://kriesi.at/support/topic/close-a-hot-spot-by-clicking-anywhere-away-from-it/#post-1277247
// https://kriesi.at/support/topic/image-hotspot-tooltips-with-click-again-again-2018/#post-1025216Best regards,
IsmaelSeptember 19, 2023 at 2:50 pm #1419583Hi Ismael,
I’m sorry it took so long, but I had to wait for the customer…I’ve tried both options, but unfortunately, I’m not getting the desired result.
// https://kriesi.at/support/topic/close-a-hot-spot-by-clicking-anywhere-away-from-it/#post-1277247
Have I placed the additional code correctly? (see screenshot)// https://kriesi.at/support/topic/image-hotspot-tooltips-with-click-again-again-2018/#post-1025216
I have also applied this, but unfortunately, no result.As you can see in the link mentioned in the private content, the popup window only closes when you click on a hotspot. Is there another solution?
September 20, 2023 at 5:23 am #1419638Hi,
Thank you for the update.
Have I placed the additional code correctly? (see screenshot)
You have to add the code below the first block.
if (this.options.event != 'click') { this.scope.on('mouseleave', default_tooltips, $.proxy(this.hide_tooltip, this)); this.scope.on('click', default_tooltips, $.proxy(this.hide_on_click_tooltip, this)); } else { this.body.on('mousedown', $.proxy(this.hide_tooltip, this)); } this.body.on('click', $.proxy(this.hide_all_tooltips, this));
You have to temporarily disable the Enfold > Performance > File Compression settings after doing the modification.
Best regards,
IsmaelSeptember 20, 2023 at 9:40 am #1419678Hi Ismael,
Thank you very much for your answer. I started over again with a fresh avia.js-file in the Enfold -folder and put “this.body.on(‘click’, $.proxy(this.hide_all_tooltips, this));” on rule no 1473.
Btw: In my code, I see ‘.bind’, in your code I don’t. Does that make a difference?
Btw2: Enfold > Performance > File Compression was already disabled, indeed (see screenshot).
Could you please take another look why the code is not working on this website?
Thanks,
ItaSeptember 21, 2023 at 5:25 am #1419818Hi,
Thank you for following up.
We may need to login to the site in order to properly test the modification. Please provide the login details in the private field.
Best regards,
IsmaelSeptember 21, 2023 at 9:08 am #1419837This reply has been marked as private.September 21, 2023 at 12:13 pm #1419888Hi,
Thank you for the info.
Instead of editing the avia.js file, we just added this script in the functions.php file.
function av_hide_show_tooltips (){ ?> <script> (function( $ ) { $('body').on( "click", function(e) { $(this).children('.avia-tooltip').hide(); }); })(jQuery); </script> <?php } add_action('wp_footer', 'av_hide_show_tooltips');
This should hide all active tooltip when you click anywhere in the document.
Best regards,
IsmaelSeptember 21, 2023 at 5:16 pm #1419939Hi Ismael,
This works great! Exactly what the client was looking for. Thanks a lot!!
Cheers,
ItaSeptember 21, 2023 at 5:54 pm #1419945Hi,
Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Image with hotspots; close onclick’ is closed to new replies.