Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrollbar problem

Status
Not open for further replies.

dannyando

Programmer
Joined
Apr 3, 2006
Messages
3
Location
GB
I have a flashing scrollbar which works fine, however it makes the mouse flicker. I would like to use a cusom cursor, though cannot because the scrollbar makes the mouse flicker and so not possible to see the cursor properly. Is there anyway i can overcome this by keeping the scrollbar? ( this is in an external file. I have put in in the actual file, but this didnt fix the problem)
Here is the scrollbar code...



Code:
function eightb()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="504823";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="6a3810";
}
setTimeout("one()",100);
}

function sevenb()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="595027";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="5f320f";
}
setTimeout("eightb()",100);
}

function sixb()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="63592b";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="552d0d";
}
setTimeout("sevenb()",100);
}

function fiveb()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="6a5f2d";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="4e290c";
}
setTimeout("sixb()",100);
}

function fourb()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="746832";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="46250b";
}
setTimeout("fiveb()",100);
}

function threeb()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="7d7035";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="3e210a";
}
setTimeout("fourb()",100);
}

function twob()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="87793a";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="361d08";
}
setTimeout("threeb()",100);
}

function oneb()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="90813e";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="2a1607";
}
setTimeout("twob()",100);
}

function eight()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="87793a";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="361d08";
}
setTimeout("oneb()",100);
}

function seven()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="7d7035";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="3e210a";
}
setTimeout("eight()",100);
}

function six()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="746832";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="46250b";
}
setTimeout("seven()",100);
}

function five()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="6a5f2d";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="4e290c";
}
setTimeout("six()",100);
}

function four()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="63592b";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="46250b";
}
setTimeout("five()",100);
}

function three()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="595027";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="4e290c";
}
setTimeout("four()",100);
}

function two()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="504823";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="552d0d";
}
setTimeout("three()",100);
}

function one()
{
with(document.body.style)
{
scrollbarDarkShadowColor="dcc547";
scrollbar3dLightColor="f2db70";
scrollbarArrowColor="dcc547";
scrollbarBaseColor="dcc547";
scrollbarFaceColor="504823";
scrollbarHighlightColor="dcc547";
scrollbarShadowColor="dcc547";
scrollbarTrackColor="6a3810";
}
setTimeout("two()",100);
}

setTimeout("one()",500);
 
I don't get the stuttering effect you describe in IE6, but I wanted to post some alternate code for you. Using IE, you can replace all of the above with:

Code:
<style>
.bodyScrollColors{
 scrollbar-DarkShadow-Color="dcc547"; 
 scrollbar-3dLight-Color="f2db70"; 
 scrollbar-Arrow-Color="dcc547"; 
 scrollbar-Base-Color="dcc547"; 
 scrollbar-Highlight-Color="dcc547"; 
 scrollbar-Shadow-Color="dcc547"; 
}
</style>
<script>
var trackColors = new Array('6a3810', '552d0d', '4e290c', '46250b', '4e290c', '46250b', '3e210a', '361d08', '2a1607', '361d08', '3e210a', '46250b', '4e290c', '552d0d', '5f320f', '6a3810');

var faceColors = new Array('504823', '504823', '595027', '63592b', '6a5f2d', '746832', '7d7035', '87793a', '90813e', '87793a', '7d7035', '746832', '6a5f2d', '63592b', '595027', '504823');

var currIndex = 0;

function updateColor()
{
 document.body.style.scrollbarTrackColor = trackColors[currIndex % trackColors.length];

 document.body.style.scrollbarFaceColor = faceColors[currIndex % faceColors.length];

 currIndex++;

 setTimeout("updateColor()",100);
}

setTimeout("document.body.className='bodyScrollColors';updateColor()",500);
</script>

Much shorter and, I believe, easier to understand (you can see right off that most of the colors do not change, for example).

What version of IE are you using?

Dave

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...east is east and west is west and if you take cranberries and stew them like applesauce
they taste much more like prunes than rhubarb does
[infinity]
 
P.S., by "I don't get...", I don't mean that I don't understand. I mean that I tried your code and could not repeat the problem you describe.

Dave

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...east is east and west is west and if you take cranberries and stew them like applesauce
they taste much more like prunes than rhubarb does
[infinity]
 
Thanks for the nice nifty version of the script is has helped a lot in uderstanding and organization, however it did not stop the cursor problem as it still flickers. I am using version 6.xxx of ie.
 
Are you saying the mouse flickers when it is over the BODY or over the SCROLLBAR? I have not been able to figure out how to change the mouse when it is over the scrollbar.

This is the code I used to test out the scrollbar in IE6. See if it differs from yours at all. If it does, post your whole page. Maybe the problem is elsewhere.

Code:
<html>
<head>
<style>
.bodyScrollColors{
 scrollbar-DarkShadow-Color="dcc547"; 
 scrollbar-3dLight-Color="f2db70"; 
 scrollbar-Arrow-Color="dcc547"; 
 scrollbar-Base-Color="dcc547"; 
 scrollbar-Highlight-Color="dcc547"; 
 scrollbar-Shadow-Color="dcc547"; 
 scrollbar-cursor:hand;
}
</style>

<script>
var trackColors = new Array('6a3810', '552d0d', '4e290c', '46250b', '4e290c', '46250b', '3e210a', '361d08', '2a1607', '361d08', '3e210a', '46250b', '4e290c', '552d0d', '5f320f', '6a3810');
var faceColors = new Array('504823', '504823', '595027', '63592b', '6a5f2d', '746832', '7d7035', '87793a', '90813e', '87793a', '7d7035', '746832', '6a5f2d', '63592b', '595027', '504823');

var currIndex = 0;

function updateColor()
{
 document.body.style.scrollbarTrackColor = trackColors[currIndex % trackColors.length];
 document.body.style.scrollbarFaceColor = faceColors[currIndex % faceColors.length];
 currIndex++;
 setTimeout("updateColor()",100);
}//end updateColor()

setTimeout("document.body.className='bodyScrollColors';updateColor()",500);
</script>
</head>
<body>
<pre>Hello, World!






























































































</pre>
</body>
</html>

Dave

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...east is east and west is west and if you take cranberries and stew them like applesauce
they taste much more like prunes than rhubarb does
[infinity]
 
I'm specifically using IE version 6.0.2800.1106

Dave

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...east is east and west is west and if you take cranberries and stew them like applesauce
they taste much more like prunes than rhubarb does
[infinity]
 
dannyando, what happens if you do not use a custom cursor and stick with the IE default? Does it flicker?
If not then the problem may be that IE is continually re-loading the custom cursor graphic you selected from the server causing it to flicker, this happens with IE sometimes when images are loaded within a stylesheet.



Stamp out, eliminate and abolish redundancy!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top