Jump to content

changing scrollbar in xhtml


yipyipdog

Recommended Posts

i cant change the scrollbar attributes using any of the xhtml DTD (tried both the strict and the transistional)i can get the scrollbar to change if i omit the Doctype.i first used css to change the style of the scrollbar and this only worked if i left out the Doctype, but since i want to keep the Doctype so i can have a xhtml 1.0 valid document i then tried to do it a different waythen i used the DOM Html like this:<script type="text/javascript"><!--function Changescroll(){document.body.style.scrollbarFaceColor="#520007";document.body.style.scrollbarArrowColor="#000000";document.body.style.scrollbarTrackColor="#5F0008";document.body.style.scrollbarShadowColor="#380005";document.body.style.scrollbarHighlightColor="#B80010";document.body.style.scrollbarDarkshadowColor="#000000";document.body.style.scrollbar3dlightColor="#A6696E";}//--></script>but it also only worked if i omitted the Doctype - I have come to the conclusion that none of the XHTML DTD's support changing scrollbar attributescan anyone shed some more light on this pleasemy goal is to have an XHTML valid document that can have a different looking scrollbar from the default browser scrollbar

Link to comment
Share on other sites

Changing the scrollbar colours using CSS only works in IE anyways and it is not valid CSS.I always advise against changing the scrollbar colours for these reasons. :)As for it not working even using DOM I would say yes it is something to do with the strictness of XHTML.I think W3Cs veiw on such things is the browser is not part of the website and it is not down to you how somebodys browser is styled.Though I maybe way off I am just guessing.

Link to comment
Share on other sites

My opinion is scrollbarred frames should be allowed to be colour changed :)Am I right? :)Only possible way to alter them is via direct CSS: <style>...</style> in the head section.Browsers other than IE won't use the statements though

Edited by Dan The Prof
Link to comment
Share on other sites

I carnt stand frames and dont use them anyways but that is another thing altogether. :)

Link to comment
Share on other sites

my goal is to have an XHTML valid document that can have a different looking scrollbar from the default browser scrollbar

This page is valid xhtml and has different coloured scrollbars (IE only)I used your javascript so you can't have been far off!
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">        <!-- template of basic structure of an xhtml file -->        <head>                <title>Basic XHTML Document Structure</title><script type="text/javascript">function Changescroll(){document.body.style.scrollbarFaceColor="#520007";document.body.style.scrollbarArrowColor="#000000";document.body.style.scrollbarTrackColor="#5F0008";document.body.style.scrollbarShadowColor="#380005";document.body.style.scrollbarHighlightColor="#B80010";document.body.style.scrollbarDarkshadowColor="#000000";document.body.style.scrollbar3dlightColor="#A6696E";}</script>        </head>        <body onload="Changescroll()">                Hello World from an XHTML File.        </body></html>

This Page Is Valid XHTML 1.0 Transitional!

Link to comment
Share on other sites

This page is valid xhtml and has different coloured scrollbars (IE only)I used your javascript so you can't have been far off!
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">        <!-- template of basic structure of an xhtml file -->        <head>                <title>Basic XHTML Document Structure</title><script type="text/javascript">function Changescroll(){document.body.style.scrollbarFaceColor="#520007";document.body.style.scrollbarArrowColor="#000000";document.body.style.scrollbarTrackColor="#5F0008";document.body.style.scrollbarShadowColor="#380005";document.body.style.scrollbarHighlightColor="#B80010";document.body.style.scrollbarDarkshadowColor="#000000";document.body.style.scrollbar3dlightColor="#A6696E";}</script>        </head>        <body onload="Changescroll()">                Hello World from an XHTML File.        </body></html>

This Page Is Valid XHTML 1.0 Transitional!

scott, this is interesting as it doesnt work unless the "<?xml version="1.0" encoding="UTF-8"?>" is addedmy document started out as:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%response.Charset="utf-8"%><html xmlns="http://www.w3.org/1999/xhtml">any thoughts as to why?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...