Streaming live at 10am (PST)

Play sound upon scroll section

Hi everyone, im trying to implement this code onto my website.

Basically, im trying to play a sound when a user scroll to a section on my page.

I have created an id #counter on my section but nothing happened when i scrolled to that section.

This is the script in my custom coding.

  var played = false;
  $(window).scroll(function() {
    var elemTop = $('#counter').offset().top, 
            elemHeight = $('#counter').outerHeight(), 
            windowHeight = $(window).height(),
            windowScroll = $(this).scrollTop();
    var countdownSound = new Audio(src="");

    if( windowScroll > (elemTop + elemHeight - windowHeight) ) {;

May i get an assistance on this?

Thank you.

Please try to format your code in your posts. Poorly formatted questions are difficult to understand.

To format code, select each code block and click the (Preformatted text) button.


I have edited your post for free this time.

sorry, i do not get what you mean. Is there something wrong with the code?

Thank you for helping to improve on my question, is there anything else that is unclear?

Please let me know.

Welcome to the Webflow forum!

Could you please edit your post Screenshot_2017-08-16_140811 and provide ALL the necessary details in your post so we can take a look at your site/issue?

If you want faster replies and more accurate answers, it is recommended that you put in a bit more effort to include all the details listed in this link, so that forum members don’t have to waste time following up with you to request more information.

Hope to hear from you soon. Thanks!