javascript - Replace image in DIV on Phonegap -
I write an application in PhoneGap and I need to create a function:
Play button, An image appears in the DIV and after 3 seconds it automatically turns into another image.
& lt; Div id = "imgtrening" & gt; & Lt; div class = "cw1a" style = "display: none" & gt; & Lt; Img style = "width: 100%"; Src = "picture / cw1a.jpg" alt = "" & gt; & Lt; / Div & gt; & Lt; div class = "cw1b" style = "display: none" & gt; & Lt; Img style = "width: 100%"; Src = "picture / cw1b.jpg" alt = "" & gt; & Lt; / Div & gt; & Lt; / Div & gt; and after clicking on the button id = "play":
document.getElementById ('play'). Onclick = function () {$ ('.cw1a'). CSS ('display', 'block') sleep (3000); $ ('.cw1a'). CSS ('display', 'none') $ ('.cw1b') CSS ('display', 'block')}; Unfortunately, my application waits for 3 seconds and shows the second image (I do not see the animation effect) (sleep has another function 3000 milliseconds): (
This is because .css ('display', 'block') or .css ('display' > .
Comments
Post a Comment