
Originally Posted by
sbmhome
<script>
function showObject(obj){
var el = document.getElementById(obj);
el.style.display = '';
}
function hideObject(obj){
var el = document.getElementById(obj);
el.style.display = 'none';
}
function changeBackgroundColors(){
//Show update image
showObject('updateMessageDIV');
//do some kind of work
for (i = 0; i < 3; i++){
// alert("See...Now the pic showed up!"); //Uncomment this alert to see the PIC!
if (float1.style.background =="red"){
backGroundColor ="green";
} else{
backGroundColor ="red";
}
float1.style.background = backGroundColor;
}
//hide Update image
hideObject('updateMessageDIV');
}
</script>
<style type="text/css">
#float1 {width:200px;margin: 0 auto;background: #FFFFFF;padding-top:2px; padding-bottom:2px;padding-left:3px; padding-right:3px;
top:100px;
position:absolute;left:200px;z-index:200000;}
</style>
<html>
<body>
This shows that my show and hide functions work:<br>
<a href="#" onclick="showObject('updateMessageDIV');"> showOjbect</a>
<a href="#" onclick="hideObject('updateMessageDIV');"> hideOjbect</a><br><br>
This starts the Test of the below text
<a href="#" onclick="changeBackgroundColors();"> change background colors</a>
<div id="float1">
The background for this text will change
</div>
<br><br><br><br><br><br><br><br>
To check this out correcty
Yahoo Image below:<br>
<div id="updateMessageDIV" style="display:none;">
<img src="http://us.i1.yimg.com/us.yimg.com/i/ww/beta/y3.gif">
</div>
<br>
1. The Yahoo image SHOULD appear before the color changes<br>
2. To see that this is the case, uncomment the "alert" in the changeBackgroundColors() function.
</body>
</html>
Bookmarks