• Resolved fulcrum85

    (@fulcrum85)


    Hello,

    is there a way, to change the touch behaviour of Ventus widget? My problem is, when scrolling on mobile device trough my website and reaching the Windy map, the users finger will move the map instead of scrolling further on the page. I would like to make it similar to the Googel Maps widget for instance.

    Thank you for your help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author David Matthew

    (@davidmatthew)

    Hi fulcrum85,

    Unfortunately this would involve a change of the underlying windy widget (developed by windy.com), for which Ventus is essentially a wrapper.

    You might be able to implement a workaround by wrapping the Ventus shortcode in a div, and setting pointer-events to none, e.g.

    <div style="pointer-events: none">[ventus]</div>

    With a media query, you could implement this on mobile devices only. Please note though that this isn’t supported by the widget and is not intended as a solution per se, only a suggested workaround.

    Hope this helps.

    Thanks,
    David

    Thread Starter fulcrum85

    (@fulcrum85)

    Dear David,

    I’ll give it a try.

    Thank your for the fast answer and thank you for your time and effort you put in this plugin, it is awesome.

    Plugin Author David Matthew

    (@davidmatthew)

    Thanks very much fulcrum85, I really appreciate that!

    Just to elaborate on the code snippet (not sure if you’re a web developer or not), if you wanted to just disable touch events on mobile and tablets, you could use something like this CSS:

    
    #id-of-containing-div {
      pointer-events: none;
    }
    
    @media (min-width: 992px) {
      #id-of-containing-div {
        pointer-events: auto;
      }
    }
    

    Thanks,
    David

    Thread Starter fulcrum85

    (@fulcrum85)

    Dear David,

    I am not a professional, just doing an aviation related (non-profit) website for fun, I picked up all my WordPress and coding knowledge on the internet.

    Thank you again for the detailed code, it works like a charm. Now I will do some testing and asking around amongst users and decide whether to use your solution or keep the original functionality of the widget and simply put more blank space in between the maps, so the users can scroll without touching the map itself.
    (To be honest, after your first answer I tried to dig up the internet for some solution / code to add the widget the two fingers manipulation only, so avoiding my original problem but I had to realize that writing such code is way beyond my knowledge. 😀 )

    By any chance if you are planning your next project, an OGN tracker plugin would be epic, the WordPress community lacks of good aviation related content. (OGN is an open source project for tracking aircrafts, there are many websites and apps to follow these trackers-aircrafts, but nothing WordPress related.)

    Thank you again for the answer, it is quite rare that a developer directly communicates with the users, especially in case of a free product.

    Greetings from Hungary

    Plugin Author David Matthew

    (@davidmatthew)

    Hi fulcrum85, thank you again for the feedback and encouragement, and the idea about an OGN tracker plugin. I don’t know much about this topic but I will look into it! It seems like an interesting subject.

    I’m glad the code worked for you, and I really appreciate your positive comments. It’s a reminder of how supportive the WordPress community can be and motivates me to keep contributing. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Touch behaviour’ is closed to new replies.