/    Sign up×
Community /Pin to ProfileBookmark

Script Image Prob..

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!”; [color=red]<—*This is where I tried <img src=”” width=”” height=””>—!>[/color]
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.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Dragon_MastaauthorNov 03.2003 — 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.
Copy linkTweet thisAlerts:
@FangNov 03.2003 — 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!
Copy linkTweet thisAlerts:
@Dragon_MastaauthorNov 03.2003 — Thanks for responding. I'll elaborate:

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

var description = 'Halloween! <img src="images/mypic.gif" [color=red]width="20" height="20">[/color]'; 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 = [color=red]'[/color]"Halloween!"[color=red] + pic1'[/color];

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!
×

Success!

Help @Dragon_Masta spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...