Home › Forums › General Questions › Ignoring certain pointer events
- This topic has 5 replies, 2 voices, and was last updated 5 years, 10 months ago by Yuri Kovelenov.
-
AuthorPosts
-
2019-01-26 at 11:27 am #10853RenierMyburghCustomer
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.
:)
2019-01-27 at 9:52 am #10855Yuri KovelenovStaffHi,
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.html2019-01-27 at 11:09 am #10857RenierMyburghCustomerThanks 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?
2019-01-28 at 8:09 am #10871Yuri KovelenovStaffthe 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?
2019-01-28 at 9:23 am #10873RenierMyburghCustomerWhen the cursor rests inside of the iframe (not just above it) is when it grabs the cursor.
2019-01-28 at 1:39 pm #10874Yuri KovelenovStaffOkay, 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
-
AuthorPosts
- You must be logged in to reply to this topic.