We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Ignoring certain pointer events

Home Forums General Questions Ignoring certain pointer events

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #10853
    RenierMyburgh
    Customer

    Hi,

    I’m wondering is there a way to differentiate between click events and scroll events in V3D?

    For example, on a website, I might have a scene embedded but I don’t want it to catch the mouse cursor when I scroll past it, but still be interactive when I click on objects or rotate with a left-click.

    I’ve managed to use CSS to disable cursor events completely like so:

    iframe {
    pointer-events: none;
    }

    But I would rather only disable the scroll wheel and leave click events as is.

    Does that make sense?

    My other option is to replace my iframe with an image of the same size and then only showing the scene when the image is clicked, but I would still want it to load in the background so that it doesn’t only start loading when the image is clicked. At that stage it should already be loaded.

    Hope you can point me in the right direction.

    :)

    #10855

    Hi,

    I found this example on how this can be done:
    http://jsfiddle.net/thiagoh/xspxoh04/
    You can try to integrate it as described here:
    https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html

    Chief 3D Verger | LinkedIn | Twitter

    #10857
    RenierMyburgh
    Customer

    Thanks for the reply Yuri.

    Unfortunately this way the iframe still grabs the scroll wheel when the cursor rests over it, which is the problem I’m trying to solve.

    I guess that I will have to go for my plan B, which is to use an image over the iframe that I can then make disappear, as in {display: none}, when clicked. I’m sure this UX problem must have come up before?

    Can you tell me how I would make the scene load in the background so that if the image gets clicked the scene is already there ready to be interacted with?

    #10871

    the iframe still grabs the scroll wheel when the cursor rests over it

    That jsfiddle example works for me in Chrome and FF. That is, when I hold the mouse cursor above the iframe, the iframe and the page do not react to mouse wheel at all. Or the problem arises when you use Verge3D app in the iframe?

    Chief 3D Verger | LinkedIn | Twitter

    #10873
    RenierMyburgh
    Customer

    When the cursor rests inside of the iframe (not just above it) is when it grabs the cursor.

    #10874

    Okay, maybe I missed something… Anyway, regarding your second question

    Can you tell me how I would make the scene load in the background so that if the image gets clicked the scene is already there ready to be interacted with?

    – this can be implemented by covering the iframe with an image or div, so that once the scene is loaded, it can be hidden with the preloader/on finish do puzzle. I guess the most relevant example is this: https://www.soft8soft.com/docs/manual/en/introduction/Puzzles.html#setup_preloader

    Chief 3D Verger | LinkedIn | Twitter

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.