Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-30-2012, 02:40 PM   PM User | #1
huskie
New Coder

 
Join Date: Apr 2011
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
huskie is an unknown quantity at this point
HTML5 audio and IOS headache.

Hi,

Is there anyone that can help resolve the issue of using the HTML5 audio tag when pressing an image. I am designing an app to use on Apple IOS for my young child to learn images and sounds together. I am using the HTML5 tag with some inline js but when I add this it throws my images about. I am guessing that there is some kind of hidden control to the side of the image that is shifting them around the screen?

<a class="pig" href="javascript:;" onclick="document.getElementById('pig').play();"><audio id="pig" src="audio/pig.mp3"></audio><img src="images/pig.png" height="230" width="230" alt="Pig"/></a>

Last edited by huskie; 11-30-2012 at 03:23 PM..
huskie is offline   Reply With Quote
Old 11-30-2012, 05:49 PM   PM User | #2
StevenHu
Regular Coder

 
Join Date: Jun 2011
Location: CA
Posts: 105
Thanks: 0
Thanked 10 Times in 10 Posts
StevenHu is an unknown quantity at this point
I'm not sure you should wrap an audio tag inside an <a href>, only the img tag.

Look at this page and see if it helps:
http://www.w3schools.com/tags/tag_audio.asp
__________________
Steve Husting
http://iphonedevlog.wordpress.com
StevenHu is offline   Reply With Quote
Old 12-04-2012, 10:46 AM   PM User | #3
huskie
New Coder

 
Join Date: Apr 2011
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
huskie is an unknown quantity at this point
I have looked at loads of information on audio tags but I haven't managed to get the audio working on mobile safari without them. Any other suggestion would be great.
huskie is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:53 PM.


Advertisement
Log in to turn off these ads.