View Full Version : Scroll Bar Help
Wes2000
08-30-2002, 12:33 AM
Hey, im looking for some help on making a colored scroll bar in JavaScript. Im new to JavaScript, but I do have an uinderstanding of the language. I was trying
document.body.style.scrollbar=
but nothing. Also if anyone knows where i can find a list of all the .stuff like .getDay .getMonth, but all of them for everything. Thanks
Quiet Storm
08-30-2002, 12:46 AM
*shameless plug*
Check out my site, I've got both of what you're looking for (colored scrollbars & Day/Month/Date/year + Local Time)
Just right-click to view source. :)
Internet Explorer 5.0+ only...
Wes2000
08-30-2002, 01:23 AM
Hmm I see neither :(. I am looking for the scroll bars like the green ones on the right of this site. But i need to do it in JavaScript, not CCS. Also I didnt mean just date time day but everything like .scrollbar .font() .whatever :thumbsup:
Edit- That is one AWSEM site though. you should find some new content like you were thinging though.
adios
08-30-2002, 01:29 AM
<html>
<head>
<title>untitled</title>
<script type="text/javascript" language="javascript">
onload = function() {
with (document.body.style) {
scrollbarBaseColor = '#a4ce79';
scrollbarArrowColor = '#000000';
}
}
</script>
</head>
<body>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</body>
</html>
Quiet Storm
08-30-2002, 01:40 AM
Clock Script
Put this inside your <HEAD></HEAD>:
<!--// **JavaScripts** //-->
<script language="JavaScript">
var nav=navigator.userAgent.toLowerCase();
var isopera=false;
if (nav.indexOf('opera')!=-1) isopera=true;
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
function getthedate(){
var mydate=new Date()
var year=mydate.getFullYear()
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var tz=Math.round(mydate.getTimezoneOffset()/60)
var timezone=-7
tz+=timezone
var hourss=hours+tz;
hourss>=24?hourss-=24:hourss;
hourss<=0?hourss+=24:hourss;
if (hourss==24) hourss=0
var dn="am"
var dns="am"
if (hours>=12)
{
dn="pm"
hours-=12
}
if (hours==0) hours=12
if (hourss>=12)
{
dns="pm"
hourss-=12
}
if ((daym == "1") || (daym == "21") || (daym == "31")){ DayType = "st " }
else if ((daym == "2") || (daym == "22")){ DayType = "nd " }
else if ((daym == "3") || (daym == "23")){ DayType = "rd " }
else (DayType = "th ")
if (hourss==0) hourss=12
if (minutes<=9) minutes="0"+minutes
if (seconds<=9) seconds="0"+seconds
if (mydate.getDay()!=0)
cdate=dayarray[day]+", "+montharray[month]+" "+daym+DayType+", "+year+" - Arizona Time: "+hourss+":"+minutes+":"+seconds+dns+"</FONT>"
else
cdate=dayarray[day]+", "+montharray[month]+" "+daym+DayType+", "+year+" - Arizona Time: "+hourss+":"+minutes+":"+seconds+dns+"</FONT>"
if (document.all&&isopera!=true)
{
document.all.clock.style.position='relative'
document.all.clock.innerHTML=cdate
}
else if (document.layers)
{document.clock.visibility='show'
document.clock.document.open();
document.clock.document.write('<center>'+cdate+'</center>');
document.clock.document.close();}
else if (document.getElementById&&isopera!=true)
{
document.getElementById("clock").innerHTML=cdate
}
else document.write('<center>'+cdate+'</center>')
}
if (!document.layers&&!document.all&&!document.getElementById) getthedate()
else if (isopera!=true) setInterval("getthedate()",1000)
else getthedate();
</script>
Edit the red sections.
Put this inside the <BODY></BODY>:
<div CLASS="time" id="clock"></div>
Quiet Storm
08-30-2002, 01:42 AM
Originally posted by Wes2000
Edit- That is one AWSEM site though. you should find some new content like you were thinging though.
Thanks! I'm working on a new on now. ;)
The colored scrollbar is on the second page, lower right - "fyi" page...
Wes2000
08-30-2002, 02:49 AM
Originally posted by adios
<html>
<head>
<title>untitled</title>
<script type="text/javascript" language="javascript">
onload = function() {
with (document.body.style) {
scrollbarBaseColor = '#a4ce79';
scrollbarArrowColor = '#000000';
}
}
</script>
</head>
<body>
<br><br><br><br><br><br><br><br><br>
</body>
</html>
Cool, thanks :thumbsup:
Just one more question if someone can. Does anyone know where I can find all, or most, of the extension things? I mean like everything. Time ones, math, .scrollbar, .getDay, window.status, prompt("Wes"), .focus(), all that stuff.
adios
08-30-2002, 03:30 AM
Hmm...may I rephrase your question?
How do I do client-side programming?
Big Q. As always, I'd recommend a good book. Programming languages - even the easier ones - are generally too involved to pick up 'on-the-fly'. Here's a decent reference:
http://www.devguru.com/Technologies/ecmascript/quickref/javascript_index.html
As for books, there are so many these days...might want to check out this (http://www.amazon.com/exec/obidos/tg/detail/-/0789725762/qid=1030674223/sr=1-120/ref=sr_1_120/102-6581339-8420115?v=glance&s=books). The best documentaton, bar none, is found in David Flanagan's O'Reilly book, althought the descriptive text assumes some familiarity with programming in general. Might want to check out Thau's (http://hotwired.lycos.com/webmonkey/programming/javascript/tutorials/tutorial1.html) witty tutorial on webmonkey too. :cool:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.