Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help making images disappear and reappear???? 1

Status
Not open for further replies.

Kadanis

Programmer
Mar 21, 2002
108
GB
Does anyone know of a way to make an image invisble when the page loads then appear on a specific part of another sub running using VBS

For example

Sub hideImage()
[insert code here]
End Sub

Sub showImage()
[insert code here]
End Sub

Sub doSomethingElse()
1st action
2nd action
3rd action

showImage
End Sub

<body onLoad="hideImage()">

</body>

Thanks in advance



Am I jumping the gun, Baldrick, or are the words 'I have a cunning plan' marching with ill-deserved confidence in the direction of this conversation?
 
Hello Kadanis,

One aspect of doing thing is to make inline style display being empty or none. Something like this. (Be mindful aboutthe browser dependency. It would do on ie in this form.)
Code:
<html>
<head>
<script language="vbscript">
sub imgstyletoggle
	'msgbox document.getElementById("imgid").style.display
	if document.getElementById("imgid").style.display="none" then
		document.getElementById("imgid").style.display=""
	else
		document.getElementById("imgid").style.display="none"
	end if
end sub
sub imgstylehide
	document.getElementById("imgid").style.display="none"
end sub
</script>
</head>
<body onload="imgstylehide">
<span id="spanid">
	<image id="imgid"name="imgname" src="g91_test.jpg" style="width:300px; height:200px" />
</span>
<form name="formtest">
<input type="button" name="display" value="display" onclick="imgstyletoggle" />
</form>
</body>
</html>
regards - tsuji
 
cool thanks tsuji. i got a solution from another source and was about to post it here but it is to all intents and purposes the same as yours

so thanks again

Am I jumping the gun, Baldrick, or are the words 'I have a cunning plan' marching with ill-deserved confidence in the direction of this conversation?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top