Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Bug Reports
  3. HTML5 Play/Pause hover won't work correctly in Element Grid

HTML5 Play/Pause hover won't work correctly in Element Grid

Scheduled Pinned Locked Moved Bug Reports
6 Posts 3 Posters 138 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    borbold
    wrote on Jan 12, 2021, 10:54 PM last edited by
    #1

    Hello,

    I was trying to implement a code mentioned in another thread. This one:

    <script> 
            window.laytheme.on("newpageshown", function(){
            jQuery('video').each(function(){
               this.pause(); 
            });
            jQuery('video').on('mouseenter', function(){
               this.play(); 
            });
            jQuery('video').on('mouseleave', function(){
               this.pause(); 
            });
        });
    </script>
    

    It does function kinda properly pausing when I am not hovering them, but when I am entering the page the videos are all already playing. They should already been loading as paused right from the beginning and should only be playing when I am hovering them, right?

    The elements I am using are in an element grid, could this be the problem?
    Also I am using another code I found to create a onepager menu, but as I removed it the problem above stayed the same.

    I can't post the URL public, but I can send it via message if someones up to my problem. :-)

    Thank you!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      arminunruh
      Global Moderator
      wrote on Jan 13, 2021, 2:14 PM last edited by arminunruh Jan 13, 2021, 9:14 AM
      #2

      hey

      my own code in lay theme is making html5 videos play that are in-view and set to autoplay as far as i know

      when you edit your elementgrid, double click the video (not in the preview, but on the left side where you can re-order elements)

      in there make sure you have turned autoplay off

      1 Reply Last reply
      0
      • B Offline
        B Offline
        borbold
        wrote on Jan 17, 2021, 3:30 PM last edited by
        #3

        At first: thank you for your quick reply armin!

        I see! But I am afraid its not solving my problem... When I turned autoplay off no videos are playing at all, not even when I am hovering them. That was functioning before

        So I want still images, but when hovering them I want the video to play. I tried different codes by now but I end up with the same two results every time.

        1. still video, not playing at all
        2. hover video function works, but I have to hover the image once so it freezes once

        Any further ideas?

        I'm afraid I have to really start learning jQuery to solve stuff like this. In my head I know what could be the problem, but I can't express it properly with code by myself.

        For example would it be possible to do a workaround by replacing the "play by click" function with the hover function?

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Richard
          Global Moderator
          wrote on Jan 20, 2021, 9:23 AM last edited by
          #4

          Dear @borbold

          Did you get any further with your problem? :)

          Best wishes for 2021
          Richard

          B 1 Reply Last reply Feb 25, 2021, 11:19 AM
          0
          • R Richard
            Jan 20, 2021, 9:23 AM

            Dear @borbold

            Did you get any further with your problem? :)

            Best wishes for 2021
            Richard

            B Offline
            B Offline
            borbold
            wrote on Feb 25, 2021, 11:19 AM last edited by
            #5

            @Richard-K

            Hey Richard! Thank you so much for asking. Sadly I didn't had any luck yet. I tried a lot more and then I just let it be

            But the page released you can have a look at what I mean: https://bloqmagazin.de/

            all the best

            B 1 Reply Last reply Feb 25, 2021, 11:31 AM
            0
            • B borbold
              Feb 25, 2021, 11:19 AM

              @Richard-K

              Hey Richard! Thank you so much for asking. Sadly I didn't had any luck yet. I tried a lot more and then I just let it be

              But the page released you can have a look at what I mean: https://bloqmagazin.de/

              all the best

              B Offline
              B Offline
              borbold
              wrote on Feb 25, 2021, 11:31 AM last edited by
              #6

              @borbold https://bloqmagazin.de/#team

              thats the clickable videos that I originally wanted to play on hover

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              I also code custom websites or custom Lay features.
              💿 Email me here: 💿
              info@laytheme.com

              Before you post:
              1. When using a WordPress Cache plugin, disable it or clear your cache.
              2. Update Lay Theme and all Lay Theme Addons
              3. Disable all Plugins
              4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

              This often solves issues you might run into

              When you post:
              1. Post a link to where the problem is
              2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
              3. If the problem is difficult to explain, post screenshots / link to a video to explain it
              Online Users
              Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
              laytheme.com
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Search