• Resolved daytrader007

    (@daytrader007)


    Nothing wrong with your plugin, I love it.
    However it conflicts with another script that plays videos on mouse over.
    When your plugin is active, videos don’t start playing on mouse over.

    Would you be able tell what is causing this conflict?
    And how to make both scripts work?

    Here is our script.

    
    window.onload = function() {
      const vids = document.getElementsByTagName("video")
      for (let i = 0; i < vids.length; i++) {
        vids[i].addEventListener( "mouseover", function(e) { 
          vids[i].play()
        })
        vids[i].addEventListener( "mouseout", function(e) {
          vids[i].pause()
        })
      }
    }
    
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Roel Magdaleno

    (@rokumetal)

    Hi, please, tell me the plugin’s name so I can download and test it at my local environment.

    Thanks!

    Thread Starter daytrader007

    (@daytrader007)

    The plugin used is yours “WP CountUP JS”

    We have this line in head section
    <script src="https://www.domain.com/video-play-on-mouse-over.js"></script>

    JS file contains just this code. Used to play video on mouse over it.

    window.onload = function() {
      const vids = document.getElementsByTagName("video")
      for (let i = 0; i < vids.length; i++) {
        vids[i].addEventListener( "mouseover", function(e) { 
          vids[i].play()
        })
        vids[i].addEventListener( "mouseout", function(e) {
          vids[i].pause()
        })
      }
    }

    Then in HTML content we have
    <video loop preload="auto"><source src="https://www.domain.com/video-file.mp4" type="video/mp4" /></video>

    So technically videos and everything else worked perfectly fine until we installed and activated your plugin “WP CountUP JS”. The numbers animate and count up as per your plugin fine, but videos no longer play on mouse over. We have deactivated your plugin temporary so we can have users play those video files. Until we can resolve the conflict of your plugin and our script. Thank you for helping

    Plugin Author Roel Magdaleno

    (@rokumetal)

    I see, thanks for that code, I’ll test it and resolve it.

    Plugin Author Roel Magdaleno

    (@rokumetal)

    Please, download the last version (3.1) and test it, should work now.

    Let me know. ??

    Thread Starter daytrader007

    (@daytrader007)

    Installed new update. Now videos and everything works great, except for when using this functionality with another shortcode [users_count]

    Now it just shows —
    Previous version of your plugin did work excellent when using it like bellow.

    This just gets actual number of users from the database
    [countup start="1" decimals="0" duration="5"][users_count][/countup]

    Please note, this works fine
    [countup start="1" decimals="0" duration="5"]5555[/countup]

    Plugin Author Roel Magdaleno

    (@rokumetal)

    Hmmm, weird.

    How can I get that shortcode or how you do that to get the value?

    Have you checked this option Use the end number inside the shortcode?, right?

    Maybe if I can get any access to your site to test and see what’s going on, I could solve it. If you agree, send me an email with the access: [email protected]

    Thanks.

    Plugin Author Roel Magdaleno

    (@rokumetal)

    Hey! Ignore my previous response.

    Just update the plugin to the last version (3.2) and should work.

    Let me know if it worked. ??

    Thread Starter daytrader007

    (@daytrader007)

    We use this PHP code in the functions file to get users count

    // Function to return user count
    function wpb_user_count() { 
    $usercount = count_users();
    $result = $usercount['total_users']; 
    return $result; 
    } 
    // Creating a shortcode to display user count
    add_shortcode('user_count', 'wpb_user_count');

    We have these codes side by side

    [countup start="1" decimals="0" duration="5"][user_count][/countup]
    [countup start="1" decimals="0" duration="5"]5555[/countup]

    Result
    https://prnt.sc/erf2e4

    Please note that both codes worked fine in previous version of your plugin, I am worried if there are other people using shortcodes to show dynamic data just like in the sample above.

    Thread Starter daytrader007

    (@daytrader007)

    Trying 3.2

    Thread Starter daytrader007

    (@daytrader007)

    null

    Now everything works perfect!

    Thank you so much Roel!

    Plugin Author Roel Magdaleno

    (@rokumetal)

    Thanks to you to find out these issues.

    Glad to help! ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Conflict with another JS script’ is closed to new replies.