/    Sign up×
Community /Pin to ProfileBookmark

Javascript for marquee

Hi there please help

I am new to javascript and i am looking to put a scrolling message on my site from right to left. The code given on this site ([url]http://javascript.internet.com/text-effects/in-marquee-links.html[/url]) works great, but how do i change text colour and size? please help

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Angry_Black_ManAug 01.2007 — you've been mislead. the script you're seeing is just some n00b who decided to place a HTML element onto a webpage using javascript. its a waste of effort since you can simply just place that HTML into a page and get the same results without the javascript.

so now, essentially, your question is an HTML question.

here's some marquee reference and font tag reference for you to peruse at your leisure.
Copy linkTweet thisAlerts:
@JMRKERAug 01.2007 — Not the most modern way to do it, but try this if you must. ?
[code=php]

<!-- TWO STEPS TO INSTALL IN-MARQUEE LINKS:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>
<html>
<head>
<SCRIPT type="text/javascript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function writeMarquee() {
var str = "<marquee scrolldelay='250' scrollamount='20'>";
str += "This ordinary marquee has';
str += " <a href='http://javascript.internet.com'>* * l i n k s * *</a>";
str += " that you can click on.";
str += " <a href='http://javascript.internet.com'>GO to javascriptsource home</a>.";
str += " Use HTML formating: <b>bold</b>, <i>italic</i>, <u>etc.</u>.";
str += " <font color='red'>Color to RED</font>";
str += " <font size=+3>Size change</font>";
str += " Speed and delay also adjustable.</marquee>";
document.write(str);
}
// End -->
</script>

</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<div align="center">
<table width="30%">
<tr><td>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
writeMarquee()
// End -->
</script>
</td></tr></table>
</div>


<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 1.31 KB -->
[/code]

Note, only two lines were added to the script.

The 'var str' stuff change was only for the benefit of seeing the entire message.
×

Success!

Help @cphaggan 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 4.29,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...