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!
Hey 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,
Mike
Hi 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!
Hi,
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,
Mike
Hi 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.
Hey,
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,
Yigit
Hi 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!