PDA

View Full Version : Beginner Question about Font Attributes



JasonKing
09-19-2007, 06:13 PM
Hello Everyone!

I am a complete nab at javascript and need some help on a nice scrolling text script i have found.

Its called Cross Browser marquee at

http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm

In this line of code: var marqueecontent='<nobr><font="verdana">Dont Forget To Bookmark Us </font>

I need the scrolling text in this format:

{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #FF0000;
}

Thanks for your help!
JasonKing
http://www.ultimategripstrength.com

boogyman
09-19-2007, 06:25 PM
var marqueecontent='<nobr><font="verdana">Dont Forget To Bookmark Us </font>

the <font> tag has been depreciated, but you can use something like


var marqueecontent='<nobr><span class="heading">Dont Forget To Bookmark Us</span></nobr>';



span.heading {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #FF0000;
}

JasonKing
09-19-2007, 06:48 PM
Cheers thanks for the fast reply

That Fixed it Perfectly Thanks!

Thanks Again

JasonKing

boogyman
09-19-2007, 07:50 PM
I didnt realize you were looking to use a link instead of just regular text. just replace the span with an achor tag



var marqueecontent='<nobr><span class="heading">Dont Forget To Bookmark Us</span></nobr>';



span.heading {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #FF0000;
}




var marqueecontent='<nobr><a href="somewhere.html" class="heading>Link</a></nobr>';



a.heading:link, a.heading:visited, a.heading:hover, a.heading:active {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #f00;
}


and you can make a specific style for each of the anchor pseudo selectors, by just taking them out of that list and create their own style with whatever changes to the original. but you should follow convention of
link
visited
hover
active
or LoVe HAte those links

JasonKing
09-19-2007, 08:07 PM
Thanks Boogyman!!

solved all my problems now :D


Cheers
Jason
http://www.ultimategripstrength.com