css - scrollbars

admin

Administrator
Staff member
hi,
by using CSS I have changed my scroll bar colors.
however I am using IFRAME on the same page, I am not able to chage the colors of scroll bars on IFRAME. I want to change these also. In this iframe I am using online free guestbook. i dont have access to source code of this guestbook. at the most i can edit/delete the comments posted by blog visitors.
u see my problem now. really appreciate your help.
tks - vishAdd an ID attribute to your IFrame like this:


<IFRAME src=http://www.webdeveloper.com/forum/archive/index.php/"http://othersite.com/page.html" ID="myIFrame">
</IFRAME>


And add the following code in your HEAD tag (of course, you will have to edit the colors to what you want):


<script type="text/javascript">
<!--
function updateScrollbars(){
var ifr = document.getElementById("myIFrame");
ifr.body.style="scrollbar-face-color: #050F20;
scrollbar-shadow-color: gray;
scrollbar-highlight-color:gray;
scrollbar-3dlight-color: white;
scrollbar-darkshadow-color: dimgray;
scrollbar-track-color: #050F20;
scrollbar-arrow-color:red;"
}
window.onload=updateScrollbars();
//-->
</script>


Jonathx Jona. I have tried but no luck. do I have to use any particular DTDs in beginning of my HTML file to see if it works. I am not sure, which DTDs I have to use. Theoritically your code looks perfect, but i dont know why its not working.
thx anyway. - vishCan you post a link to your page so I can see the source code? There is no DTD that applies to this as it is based on Javascript programming.

Jonahi, jona
thx a lot for your help.
ok, here is the test page.

<!-- m --><a class="postlink" href="http://www3.sympatico.ca/adivishnu/scrolltest.htm">http://www3.sympatico.ca/adivishnu/scrolltest.htm</a><!-- m -->

i have done exactly what u told me. see the main page scrollbars. i want them on my iframe also.


have a look.
lemme know. thx - vishThis code should work, but I don't know if it does or not... I haven't been able to edit the scrollbars with CSS in any way... There must be a workaround for this, but I don't have the time to go and fool with it. ;)


function updateScrollbars(){
var ifr = document.getElementById("myIFrame").style;
ifr = ifr.document.getElementsByTagName("body")[0].style;
ifr.scrollbarFaceColor="#050F20";
ifr.scrollbarShadowColor="gray"
ifr.scrollbarHighlightColor="gray"
ifr.scrollbar3dlightColor="white"
ifr.scrollbarDarkshadowColor="dimgray"
ifr.scrollbarTrackColor="#050F20"
ifr.scrollbarArrowColor="red"
}

JonaOriginally posted by Jona
This code should work, but...If it works at all, it should only work if the page you are calling is on your domain. It will not work with Yahoo! in the iframe, as you don't have access to the <body> tag (ifr = ifr.document.getElementsByTagName("body")[0].style;) if the page is not on your domain...There is probably a way to get around it and I could figure out how to get it to work, but like I said I don't really have the time to try to figure it out or anything.

JonaThanks a lot, Pyro and Jona for your response.
I consider now it may not be possible. I gave up.
take care.
 
Back
Top