inline style changes by javascript don't work on mobile browsers (chrome/dolphin/android): why? -
expected behavior (as performed on pc/windows browser): h1 header "gif" disappears , video plays
mobile behavior: gif not disappear- video does play (so js firing)
why doesn't display toggle work on mobile (android) chrome way in windows chrome?
relivant code:
this.play(); this.removeattribute("controls"); //works //h1.style.display="none"; //does not work this.previoussibling.style.display="none"; //does not work
onclick
not valid event in touch devices. try ontouchstart
mobile version. touch event object doesn't contain offsety
. instead, can use pagey
on both mobile , desktop browsers.
here working demo.
Comments
Post a Comment