TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,027
  • Total Topics: 21,334
  • Online today: 916
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

Help with Scrollbar code.

Started by Ghostwriter, April 19, 2007, 04:04:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ghostwriter

I thought I seen something about this but the only thing I found was Marquee scroll when I looked. What I was wonder is how would I make a scrollbar on in a block for links. I got a code but it doesn't seem to work right, the scrollbar doesn't show up and with the links. Does anyone know how to fix the scrollbar code to work right..
I put it in a scriptbox..
<STYLE TYPE="text/css">

BODY
{
scrollbar-base-color: orange;
scrollbar-arrow-color: green;
scrollbar-DarkShadow-Color: blue;
}
</STYLE>
Link
link

Resident Geek

Are you using Mozilla? I have found that Mozilla doesn't give CSS scrollbars for some reason.

Also. That is CSS. You will have to create HTML to call the CSS.

use, <textarea> to create the textbox and then call the CSS to create the scrollbar.

Putting CSS inside of a script box won't give you anything.



EDIT: Could you supply the full code that you placed inside of the scriptbox and not just the CSS.

Ghostwriter

#2
That is the full code. I got it off the web...

Oh forgot to mention, what I would like to do since I am using this for character bio links on my rp forum, I also wanted to know if the scrollbar code would work with this code.

</script><script language="javascript" type="text/javascript">
<!--
/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>
<A
  href="http://www.yoursite.com" onclick="NewWindow(this.href,'angels','600','400','yes','center');return false" onfocus="this.blur()">Carry Rey </A></align> <br>


Zetan

If you view the source of the page here and "Find" the words 'overflow' that I believe is what sets up the scroll bars:

This is part of the shoutbox source code:

160px; overflow: auto;">

<div class="windowbg" style="padding:4px; " id="block11">
<table cellpadding="0" align="center" width="100%" cellspacing="0" style="table-layout: fixed;">
<tr><td><div class="smalltext" style="width: 99%; height: 160px; overflow: auto;">Last 10 Shouts:<hr /><div style="margin: 4px;"><div style="border: dotted 1px; padding: 2px 4px 2px 4px;" class="windowbg2">

Resident Geek

If that is all that you put inside of the block, then It won't do anything. The CSS isn't being called anywhere.
Try this:


<STYLE TYPE="text/css">

BODY
{
scrollbar-base-color: orange;
scrollbar-arrow-color: green;
scrollbar-DarkShadow-Color: blue;
}
</STYLE>

<textarea rows="2" cols="20">
Here is the text
</textarea>


This works for me.

Zetan

Well, thats funny... Your code sure does Nothing on my site.

Whereas this part of the code, which I pasted above in a rush leaving work:

<div class="smalltext" style="width: 99%; height: 160px; overflow: auto;">

Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text
Random Text

</div>


In a html block, seems to work on my site.

Resident Geek

#6
Yah. Using <div> is better, but I was thinking he wanted it editable. You can't edit <div> but you can <textarea>

Using <div>, here is the code you want:


<STYLE TYPE="text/css">

BODY
{
scrollbar-base-color: orange;
scrollbar-arrow-color: green;
scrollbar-DarkShadow-Color: blue;
}
</STYLE>

<div class="smalltext" style="width: 99%; height: 160px; overflow: auto;">

<script language="javascript" type="text/javascript">
<!--
/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>
<A
  href="http://www.yoursite.com" onclick="NewWindow(this.href,'angels','600','400','yes','center');return false" onfocus="this.blur()">Carry Rey </A></align> <br>
asdf<br>
asdf<br>
asdf<br>
asdf<br>
asdf<br>
horray<br>
asdf<br>
asdf<br>
asdf<br>
horray<br>
asdf<br>
asdf<br>
asdf<br>
asdf<br>
horray<br>
asdf<br>
asdf<br>
asdf<br>
horray<br>
</div>


Good luck! :)

(I'm a little confused by your choice of colors however...  :-\

Crip

I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



Zetan

Okay, that still isn't working properly on my site.. now that you included the 'overflow' part of the code, I do get scrollbars. They are not coloured, but this text which is being displayed as a hyperlink:

href="http://www.yoursite.com" onclick="NewWindow(this.href,'angels','600','400','yes','center');return false" onfocus="this.blur()">Carry Rey

In orange (which may be part of my .css as my link are set to turn orange anyway).
And I've not yet seen scrollbar colors in Firefox, IE does.

Crip

You never will see colored scrollbars in FF..this works only for IE
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



This website is proudly hosted on Crocweb Cloud Website Hosting.