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. General Discussion
  3. Mouseover sounds

Mouseover sounds

Scheduled Pinned Locked Moved General Discussion
6 Posts 3 Posters 439 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.
  • daniD Offline
    daniD Offline
    dani
    wrote on last edited by
    #1

    Hello,

    here is the page in question : http://143.95.234.103/~dianasoh/do-re-mi

    I'm trying to have mouseover sounds on the notes.

    Here is the codepen : https://codepen.io/cestdani/pen/EwevqV

    I placed this script in the 'HTML at top' section, but it's not working, and there are no errors. Help please!

    <script>

    window.laytheme.on("newpage", function(layoutObj, type, obj){

    var s1 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/1.mp3");
    var s2 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/2.mp3");
    var s3 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/3.mp3");
    var s4 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/4.mp3");
    var s5 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/5.mp3");
    var s6 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/6.mp3");
    var s7 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/7.mp3");
    var s8 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/8.mp3");

    jQuery("#note1").mouseover(function() { playme(s1); });
    jQuery("#note2").mouseover(function() { playme(s2); });
    jQuery("#note3").mouseover(function() { playme(s3); });
    jQuery("#note4").mouseover(function() { playme(s4); });
    jQuery("#note5").mouseover(function() { playme(s5); });
    jQuery("#note6").mouseover(function() { playme(s6); });
    jQuery("#note7").mouseover(function() { playme(s7); });
    jQuery("#note8").mouseover(function() { playme(s8); });

    function playme(n) {
    n.play();
    }

    });

    </script>

    https://danielcampbell.ca

    daniD 1 Reply Last reply
    0
    • daniD dani

      Hello,

      here is the page in question : http://143.95.234.103/~dianasoh/do-re-mi

      I'm trying to have mouseover sounds on the notes.

      Here is the codepen : https://codepen.io/cestdani/pen/EwevqV

      I placed this script in the 'HTML at top' section, but it's not working, and there are no errors. Help please!

      <script>

      window.laytheme.on("newpage", function(layoutObj, type, obj){

      var s1 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/1.mp3");
      var s2 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/2.mp3");
      var s3 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/3.mp3");
      var s4 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/4.mp3");
      var s5 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/5.mp3");
      var s6 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/6.mp3");
      var s7 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/7.mp3");
      var s8 = new Audio("http://143.95.234.103/~dianasoh/wp-content/uploads/2017/10/8.mp3");

      jQuery("#note1").mouseover(function() { playme(s1); });
      jQuery("#note2").mouseover(function() { playme(s2); });
      jQuery("#note3").mouseover(function() { playme(s3); });
      jQuery("#note4").mouseover(function() { playme(s4); });
      jQuery("#note5").mouseover(function() { playme(s5); });
      jQuery("#note6").mouseover(function() { playme(s6); });
      jQuery("#note7").mouseover(function() { playme(s7); });
      jQuery("#note8").mouseover(function() { playme(s8); });

      function playme(n) {
      n.play();
      }

      });

      </script>

      daniD Offline
      daniD Offline
      dani
      wrote on last edited by dani
      #2

      ah!

      it works when i change 'newpage' to 'newpageshown'

      window.laytheme.on("newpageshown", function(layoutObj, type, obj)

      https://danielcampbell.ca

      1 Reply Last reply
      0
      • daniD Offline
        daniD Offline
        dani
        wrote on last edited by
        #3

        but now this isn't working

        jQuery('.fade').on("mouseover", function () {
            jQuery(this).fadeOut(1).delay(500).fadeIn();
        }); 
        

        any idea what is wrong?
        (the same code works fine on another site here : http://duoxamp.com/ - the post-it note that fades in, then onclick it fades out)

        https://danielcampbell.ca

        1 Reply Last reply
        0
        • G Offline
          G Offline
          gdk
          wrote on last edited by
          #4

          @dani hi, did you make this work? I'm looking for the same. Which plugin / js script did you use? thank you!

          1 Reply Last reply
          0
          • daniD Offline
            daniD Offline
            dani
            wrote on last edited by
            #5

            yeah i got it to work. put this in the 'Custom HTML at bottom'

            <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
            <script>
            window.laytheme.on("newpageshown", function(layoutObj, type, obj){
                var s1 = new Audio("http://kiti.ca/wp-content/uploads/2019/10/mew.mp3"); 
                    jQuery(".mew").mouseover(function() { playme(s1); 
                });
            });
                function playme(n) {
                n.play();
                };
            </script>
            

            attach the class .mew to whatever object you want to produce the sound on mouseover.

            https://danielcampbell.ca

            1 Reply Last reply
            0
            • mariusjopenM Offline
              mariusjopenM Offline
              mariusjopen
              Global Moderator
              wrote on last edited by
              #6

              Dear @dani
              Thank you for helping!
              We appreciate the time people take to make the LayTheme community stronger.
              Best!
              Marius

              www.mariusjopen.world

              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