ColorScrollbar.js works but gives error message

W

_Who

This works. I get colored scrollbars. But why the error message?



File ColorScrollbar.js contains:

var htmlStyle = document.getElementsByTagName('html')[0].style;

htmlStyle.scrollbarShadowColor = "orange";

htmlStyle.scrollbarFaceColor = "orange";

htmlStyle.scrollbarArrowColor = "orange";

htmlStyle.scrollbarTrackColor = "maroon";

htmlStyle.scrollbarHighlightColor = "MediumVioletRed";

htmlStyle.scrollbar3dlightColor = "maroon";

htmlStyle.scrollbarDarkshadowColor = "maroon";



And Main.Master contains:

<body >

<script type="text/javascript" src="ColorScrollbar.js"></script>

But gives the message:

Warning 2 Error updating JScript IntelliSense: I:\.snip.\ColorScrollbar.js:
'document.getElementsByTagName(...).0.style' is null or not an object @ 1:4
I:\.snip.\Main.master

If I understand the docs (HTML Element | html Object) , the html tag does
not have a style attribute (but it does have styles)

Can you explain a little what is going on and maybe how I can remove the
error message??

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top