Play sound on click
-
- Posts: 1
- meble kuchenne Mikołów Knurów Czechowice-Dziedzice
- Joined: Fri Oct 23, 2015 9:29 am
- Website: INFUSEALLY
Play sound on click
I am trying to add a sound on click of an image on my home page, but every time I try to put in a script and save it the script disappears and won't keep it. How do I make sure the sound plays upon click of that image?
- Paige
- Support Team
- Posts: 461
- Joined: Fri Feb 24, 2012 3:41 am
- Website: www.allprowebtools.com
- Location: Fort Collins, CO
- Contact:
Re: Play sound on click
The WYSIWYG does not insert html or JS code that is invalid. It does accept all code that is valid however. Can you tell me the JS you are trying to use?
You can also put JS in the footer, valid or not, by going to Settings > Administrator > Theme Editor > Footer.
You can also put JS in the footer, valid or not, by going to Settings > Administrator > Theme Editor > Footer.
-
- AllPro Expert
- Posts: 17
- Joined: Wed Nov 04, 2015 8:20 am
- Website: apwt.infuseally.com
Re: Play sound on click
Thanks for the feedback Paige. This is the code I'm attempting to put in:
Code: Select all
<a title="Asset Recovery" href="/Asset-Reovery/">
<img src="/content/uploads/icons/Asset_Recovery.png" alt="Asset Recovery" width="150" height="150" onmouseover="this.src='/content/uploads/icons/Asset_Recovery_g.png';" onmouseout="this.src='/content/uploads/icons/Asset_Recovery.png';" />
</a>
Asset Recovery
</td>
- Paige
- Support Team
- Posts: 461
- Joined: Fri Feb 24, 2012 3:41 am
- Website: www.allprowebtools.com
- Location: Fort Collins, CO
- Contact:
Re: Play sound on click
We were not allowing onmouseout and onmmouseover, I have made this possible, please try it again
-
- AllPro Expert
- Posts: 17
- Joined: Wed Nov 04, 2015 8:20 am
- Website: apwt.infuseally.com
Re: Play sound on click
Thanks for your help Paige. I was able to insert the javascript function into the head of the page, however the editor still won't allow me to put in an onclick call in the link. Any suggestions?
- Paige
- Support Team
- Posts: 461
- Joined: Fri Feb 24, 2012 3:41 am
- Website: www.allprowebtools.com
- Location: Fort Collins, CO
- Contact:
Re: Play sound on click
I have added onclick as an accepted element. However I would highly recommend switch your code to jQuery for future browser compatibility, the "onclicks" of the world are being slowly phased out. Here is how you do an onclick in jQuery: https://api.jquery.com/click/
-
- AllPro Expert
- Posts: 17
- Joined: Wed Nov 04, 2015 8:20 am
- Website: apwt.infuseally.com
Re: Play sound on click
Thanks for your help Paige. Unfortunately, it's still not working. Is there anything else I can try?
- Paige
- Support Team
- Posts: 461
- Joined: Fri Feb 24, 2012 3:41 am
- Website: www.allprowebtools.com
- Location: Fort Collins, CO
- Contact:
Re: Play sound on click
What does you new code look like?