Click to See Complete Forum and Search --> : Script Image Prob..


Dragon Masta
11-02-2003, 05:01 PM
Hello,

I have this script on my page. I am having a hard time getting a small image to work in it. Like a pumkin for Halloween or a Santa image for Christmas to properly scroll after the name of the holiday.(desription)

<marquee scrolldelay="110" width="210" height="10">
<SCRIPT LANGUAGE="JavaScript">

var date = new Date("October 31 2003");
var description = "Halloween!"; <---*This is where I tried <img src="" width="" height="">---!>
var now = new Date();
var diff = date.getTime() - now.getTime();
var days = Math.floor(diff / (1000 * 60 * 60 * 24));
document.write("<center><h3>")
if (days > 1) {
document.write(days+1 + " days 'til " + description);
}
else if (days == 1) {
document.write("Only 2 days 'til " + description);
}
else if (days == 0) {
document.write("Tomorrow is " + description + "!");
}
else {
document.write("Happy " + description + "!");
}
document.write("</h3></center>");
// End -->
</script></marquee>

I wonder if I can also use standard image size tags in the img src code so I don't have to create a specific sized image for it.

Also do you know, if I can get the image to work, how I can get the image not to show up as a square, and more like the outline of the character in the image? Will Transparency work in a gif editor?

Any suggestions? I am very new to Java Script Please Help.

Dragon Masta
11-02-2003, 10:55 PM
Is there anyone out there that can help me? I'll pay dues if you want me to! Panhandle on street corners! LOL

Going to get red hair dye as we speak.

Fang
11-03-2003, 03:39 AM
var description = 'Halloween! <img src="" width="" height="">';

standard image size tags ?? explain

Use transparancy for the areas of your image you do not want to see.

<marquee> only works in Internet explorer!

Dragon Masta
11-03-2003, 10:26 AM
Thanks for responding. I'll elaborate:

"standard image size tags ?? explain": See red below

var description = 'Halloween! <img src="images/mypic.gif" width="20" height="20">'; Did not work.

I tried that and every combination thereof I could think of, anything I do there simply ceases the script from functioning.

I read I may need to put a reference in the <body> such as:

<a href="index.html" name="pic1"> <img src="images/mypic.gif" name="pic1" width="100" height="25" border="0"></a>

then add:

If (document.images)
{
pic1.src="images/mypic.gif";
}
or something like that

and:

var description = '"Halloween!" + pic1';

to the script, but that didn't work either.

Totally confused and frustrated with red hair...less and less as I pull it out

P.S. I am aware of the NS issue, working to change from <marquee> to another script for xbrows compat. First things first!

Any help greatly appreciated!