Help: onclick for ipad?
- Started
- Last post
- 12 Responses
- trooperbill
im working in a crappy cms where im having to hardcode flash banners into a widget area... not fun. theyve asked for a jpeg to be displayed when someone accesses the site using ipad/iphone so ive used
<div style="background:url(/image.gif);" onClick="http://www.mysite.com">
around the flash but the onclick doesnt trigger when you browse using your finger on the iphone etc... whats the alternative to onclick for fingers?
thanks
- clearThoughts0
yaaawn.
- animatedgif0
use this
http://www.w3.org/TR/html4/struc…
- kingsteven0
I'm not sure that code would work on any browser, surely you need to call some JS/DOM sthg like:
onClick = " window.location = 'http://www.mysite.com' "
- flashbender0
^ yeah, really... when did the <a> tag fall out of fashion?
- trooperbill0
its the onClick thats the problem it doesnt trigger with a tap :(
- because your code is wrong! needs to be in an a tagfadein11
- doktornomore0
onClick="window.location.href='s... ?
- animatedgif0
^
Yeah exactly, onClick is for executing Javascript not a drop in replacement for an <a> tag- I mean surely your code doesn't actually even work in a desktop browseranimatedgif
- i_was0
$("#ipad").click(function(){
//do your stuff
})
- mekk0
dont use onclick for a simple link:
<object type="application/x-shockwave-flash data="banner.swf"
width="100" height="200">
<param name="movie" value="banner.swf" />
<a href="http://www.link.com" >
<img src="noflash.gif" width="100" height="200" />
</a>
</object>- <mydo
- this work?trooperbill
- nope it shows both on a pctrooperbill
- so then: http://code.google.c…mekk
- trooperbill0
using <a> and wrapping the flash doesnt work either
- spot130
use this:
onClick='window.open('"http://ww... false;'