View Full Version : gif animation
smeeko
06-15-2000, 11:10 AM
Hello,
I have a large .gif animation (230K) to use as an intro to a website. Can anybody tell me how to display it only once it is completely loaded, and display a LOADING... message in the meanwhile?
Thanks for your help,
Smeeko
Jason
06-15-2000, 05:06 PM
Hi Smeeko,
You would need a java applet to do this. http://www.a1javascripts may have something to suit your needs.
------------------
Jason M. DesRoches
Co-Founder / Business Development
Big Resources Network
jason@123webmaster.com
ICQ: 17947522
[This message has been edited by Jason (edited 06-15-2000).]
Owen_MC_Evans
06-16-2000, 09:31 AM
Just had a thought,
Mabee (i'm not sure it'll work never tried it)
if you put your first SRC as a loading image and then you pre-load the gif image you could use the Body onload trigger to swap the images once the page has loaded.
Does this make any sense?
Owen
Jason
06-16-2000, 12:40 PM
I think I see what you're getting at Owen, but that would still require javascript, no?
------------------
Jason M. DesRoches
Co-Founder / Business Development
Big Resources Network
jason@123webmaster.com
ICQ: 17947522
smeeko
06-16-2000, 05:30 PM
Hi guys,
I was able to make it work on MIcrosoft Internet Explorer, but it gives me a javascript error with Netscape Navigator. Can you help me find it? The code I wrote follows.
Thanks,
Smeeko
CODE:
<script language="javascript">
<!--
figura = new Array()
figura[0] = new Image()
figura[1] = new Image()
figura[0].src = "images/avanlogo.gif"
figura[1].src = "images/avant_animation.gif"
function ChooseImage()
{
if (figura[1].src.complete = 1)
{
document.the_image.src=figura[1].src;
}
}
-->
</script>
</head>
<body bgcolor="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" onLoad="ChooseImage()">
<p align="center"><img src="images/avanlogo.gif" name="the_image" alt="avantlogo.gif"></p>
kheng
06-22-2000, 02:52 AM
Dear Smeeko,
Tried your script on IE and it works fine.Now I don't have to worry about the visitor seeing each animated frame get loaded one by one,thus,spoiling the visual impact when the animation finally starts.
One simple question:how do I get a short wav file to play when the animation starts?
There is not much discussion on sound in this forum.
smeeko
06-30-2000, 02:13 PM
I made the animation work on NN also, but it loads much slower than on IE. Does anybody have any idea why??
here is the code. Thanks and happy July 4th
smeeko
<script language="JavaScript">
figura = new Array();
figura[1] = new Image();
figura[2] = new Image();
figura[1].src = "images/avant_animation.gif";
figura[2].src = "images/loading700.gif";
function ChooseImage() {
var i = 2;
var nav = window.navigator.userAgent;
if(nav.indexOf("MSIE 5") != -1 | | nav.indexOf("MSIE 4") != -1) {
if (figura[1].complete) {
document.the_image.src = figura[1].src;
document.the_image.width = 559;
document.the_image.height = 360;
}
}
else{
while (!figura[1].complete){
i++;
}
document.the_image.src = figura[1].src;
}
}
</script>
</head>
<body bgcolor="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" onLoad="ChooseImage()">
<table width="100%" height="100%">
<tr>
<td height="90%"><p align="center"><img src="images/loading700.gif" name="the_image"
alt="avantlogo" width="700" height="400"> </td>
...
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.