-
AuthorPosts
-
November 28, 2019 at 3:48 pm #1161011
Hi,
I have a question related to my gallery: i’d like to block the funtion to open an image in another window with the mouse wheel button.
I have yet a plugin to block the right click on images (for example to block the download of the images), but i noticed that i can open the images in a new window with the mouse wheel button. I’d like to know if is there the possibility to do avoid it.
Thanks a lot for the support!December 1, 2019 at 2:45 am #1161531Hey Real-3D,
Sorry for the late reply, I assume that your mouse wheel button is programmed to do that, as mine is not.
But I believe this solution will work for you, or perhaps one of these.Best regards,
MikeDecember 2, 2019 at 10:05 am #1161777Hi and thanks.
I tried all the solutions suggested in the provided links by putting the codes in General styling- CSS, but noone worked for me…
Any other solutions?
Thanks a lot for the help!December 2, 2019 at 1:10 pm #1161847Hi,
These are javascript solutions, they don’t go into the css area.
Try adding this code to the end of your functions.php file in Appearance > Editor:function custom_script_wheel(){ ?> <script> (function($){ $(window).on('mousewheel DOMMouseScroll', function() { return false; }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script_wheel');Best regards,
MikeDecember 5, 2019 at 12:50 pm #1162953Hi and thanks.
I tied the provided code but it doesn’t work…The mouse button continues to be active. Is there a reason why it doesn’t work for me?
Or is there an other solution?
Thanks and best regards.December 5, 2019 at 12:55 pm #1162958Hey,
This is not theme related but browser feature therefore unfortunately such customization would be out of the scope of our support. Please consider to hire a freelance developer for the task.
Best regards,
YigitDecember 5, 2019 at 12:59 pm #1162969Hi and thanks for the support, I imagined that it would have been a rather complex setup.
I will keep the way it is now.
Thanks again and best regards!December 5, 2019 at 1:34 pm #1162972 -
AuthorPosts
- The topic ‘Block mouse wheel button to open images’ is closed to new replies.
