Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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!

    #1161531

    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

    #1161777

    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!

    #1161847

    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

    #1162953

    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.

    #1162958

    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

    #1162969

    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!

    #1162972

    Hi,

    Not at all! Please let us know if you have any other questions or issues :)

    Best regards,
    Yigit

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Block mouse wheel button to open images’ is closed to new replies.