Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search

IanHost

Circle Member
  • Posts

    2
  • Joined

  • Last visited

Everything posted by IanHost

  1. Hey guys, this code I have found/put together from what i know, but when previewing in mobile, my hidden audio block doesn't autoplay. Can anyone help please? <script> window.addEventListener('DOMContentLoaded', function() { //wait for document load var audio = document.querySelector('.sqs-audio-embed'); //select the audio block var checkOnLoad = function() { if (window.pageYOffset > 200) { } else { audio.play(); } {audio.loop = true;} }; if (audio) { var url = audio.getAttribute('data-url'); //get the audio src Y.one(audio).ancestor('.sqs-block-audio').setStyle('display','none'); audio = new Audio(url); window.addEventListener('load', checkOnLoad); //listen for window load and toggle audio state checkOnLoad(); } }) </script>
×
×
  • Create New...