PDA

View Full Version : How to set a bold font



yaraco
04-18-2010, 03:11 PM
1) Script Title: Local Time Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex6/localtime.htm

3) Describe problem:

How to set a bold font of the time number

Best regards

djr33
04-18-2010, 06:28 PM
I believe you could do this using CSS to modify the class of the <div> tag or ID of the <span> tag.

yaraco
04-18-2010, 10:10 PM
Thank you for reply

I tried but failed

the time number code is:



showLocalTime.prototype.updateContainer=function(){
var thisobj=this
if (this.displayversion=="long")
this.container.innerHTML=this.localtime.toLocaleString()
else{
var hour=this.localtime.getHours()
var minutes=this.localtime.getMinutes()
var seconds=this.localtime.getSeconds()
var ampm=(hour>=12)? "PM" : "AM"
var dayofweek=weekdaystxt[this.localtime.getDay()]
this.container.innerHTML=formatField(hour, 1)+":"+formatField(minutes)+":"+formatField(seconds)+" "+ampm+" ("+dayofweek+")"
}


Where I should place class

djr33
04-19-2010, 02:27 AM
Current Server Time:<span id="timecontainer"></span><br />
Current LA Time:<span id="timecontainer2"></span><br />
Current New York Time:<span id="timecontainer3"></span><br />

That's the HTML. This is not related to the Javascript.

You will use CSS (external .css file or <style>...</style> within <head>) to set properties for the ID 'timecontainer', or you could set the whole thing as a class if you'd prefer, such as in a <div>.

yaraco
04-19-2010, 08:55 AM
I do it in this way. it works greatly


<b>Current Server Time:<span id="timecontainer"></span></b><br />
<b>Current LA Time:<span id="timecontainer2"></span></b><br />
<b>Current New York Time:<span id="timecontainer3"></span></b><br />

I have another question please.

In this catagory (Dynamic Drive scripts help) when I get a new thread these


1) Script Title:

2) Script URL (on DD):

3) Describe problem:

are shown.

How can I do like that?

Thanks a lot

djr33
04-19-2010, 05:33 PM
I don't understand.

Do you want to ask a new question? "How do I post a new question?"

Or do you want to CREATE a forum/system that has default text like what you see above?
That is probably a better question to ask somewhere else, like in the PHP area.

yaraco
04-19-2010, 06:01 PM
Or do you want to CREATE a forum/system that has default text like what you see above?
That is probably a better question to ask somewhere else, like in the PHP area

That is exactly what I want. I will ask somewhere else.

--------

My Local Time Script is finished, and I save it as php file, and name it "time.php"

now how to include the file "time.php" in my forum without iframe class, because iframe class give a white background, I want it clear.