Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • 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 663 Views 1 Watching
  • 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
    B
    borbold
    wrote on 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
    • arminunruhA
      arminunruhA
      arminunruh
      Global Moderator
      wrote on last edited by arminunruh
      #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
        B
        borbold
        wrote on 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
        • RichardR
          RichardR
          Richard
          Global Moderator
          wrote on last edited by
          #4

          Dear @borbold

          Did you get any further with your problem? :)

          Best wishes for 2021
          Richard

          B 1 Reply Last reply
          0
          • RichardR Richard

            Dear @borbold

            Did you get any further with your problem? :)

            Best wishes for 2021
            Richard

            B
            B
            borbold
            wrote on 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
            0
            • B borbold

              @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
              B
              borbold
              wrote on 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

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              Online Users
              A
              alasdair17
              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