top of page

Forum Posts

AaronH
Jun 24, 2020
In Coding with Velo
I'm redesigning my site, and on the home page (https://aaronhelgeson.wixsite.com/mysite) I'm trying to change between a translucent and transparent header on scrolldown. However, the translucent header doesn't load when scrolling down. Any help? Here's the code I'm using... $w.onReady(function () { $w('#translucentHeader').hide(); $w('#transparentHeader').show(); }); export function header_viewportLeave(event) { let fadeOptions = { "duration": 300, "delay": 0 }; $w('#translucentHeader').show("fade", fadeOptions); $w('#transparentHeader').hide("fade", fadeOptions); } export function header_viewportEnter(event) { let fadeOptions = { "duration": 300, "delay": 0 }; $w('#translucentHeader').hide("fade", fadeOptions); $w('#transparentHeader').show("fade", fadeOptions); }
0
7
711
AaronH
Jul 28, 2018
In Coding with Velo
Is there a way to create an HTML Component audio player on a dynamic page that plays an audio file from a URL grabbed from the page's linked data collection? I know that dynamic pages don't currently support audio, but I'm trying to make a work-around. Using suggestions from this thread... https://www.wix.com/code/home/forum/community-discussion/playing-audio-dynamically ...I've made the following code to 1) get the URL for the audio file from the current item in the data collection, and 2) send it to an HTML component that plays the audio on page load: PAGE CODE $w.onReady(function () { $w("#html1").postMessage($w("#dynamicDataset").getCurrentItem().audioSample); }); HTML COMPONENT <script type="text/javascript"> window.onmessage = (event) => { if (event.data) { let receivedData = event.data; var audio = new Audio(receivedData); audio.play(); } }; </script> Is there a way to implement this using a simple HTML audio player with controls (play/pause, etc)? Ideally I'd customize style characteristics too (control color, background color, etc) but even using the native browser audio controls would be better than autoplay.
0
12
1k

AaronH

More actions
bottom of page