Thursday, February 21, 2013

HOW TO ADD IMAGE INSIDE A DIV AND CONTINUE FOR A QUICK PROCESS

                        HOW TO ADD IMAGE INSIDE A DIV AND CONTINUE FOR A QUICK PROCESS
You can traverse the html tree and you can handle all the leafs individually that gives you possibility to play some part of tree. For example if you want to add a div then continue to work that can cause some problem such as you can not see new image in the specified div. Lets code for a button when we click it lets change the div' s image and continue with the other page. I used html5 on Lg and Samsung when i coded. For example this is the button below;


<a href="javascript:route();" id="signup" style="height: 200px; width: 100px"><div id="container"><IMG SRC="oldimage.gif" id="myid"></div></a>

now script turns;
<script type="text/javascript" >

function route(){
var willBeRemoved = document.getElementById("myid");
var container= document.getElementById("container");
container.removeChild(willBeRemoved);
var newimage = document.createElement("img");
oImg.src = "newPicture.gif";
container.appendChild(newimage);
setInterval(function(){changePage()},100);
}
function changePage(){
window.location.href="signup.html";
}

</script>

The code above will add functionality to change image before loading another page because of the process speed there will be no time to change the image but if you specify a duty to process the function it will find a spare time to change...

It is also problem in jquery mobile that if you want to show an information page in time of process you will use the function below;

$.mobile.showPageLoadingMsg("e", "Your Page Is Loading \n Please Wait", true);

the function above takes 2 argument first one is the theme of the window second one is the message that you want to show. Now if you use this function in the gap between two process that will work in a series that will show error in logcat so you can prevent such a strategy we followed for the image and div example.

No comments:

Post a Comment