This is not an update to the original, but I have another suggestion
for you. Scriptaculous has a wonderful scroller effect that can be
enabled in very few lines of code. Download the Protaculous Action
here: http://freewaypro.com/actions/downloads and install it in
Freeway. That will get you access to the rest of this magic.
Now have a look here: http://scripty.walterdavisstudio.com/scroll
If you click on the Freeway icon, you can download the Freeway5
example app, which will go a long way toward making this easier to
understand. It’s already taken me longer to explain this than it did
to create.
The few lines of code, for those who are interested, are as follows:
var s = new Control.Slider('thumb','track', {axis:'vertical'});
var f = function(value){
var inner = $('innerDiv');
//change innerDiv to whatever your inner box is called
var h = (inner.getHeight() - inner.up('div').getHeight());
inner.style.top = (Math.round(value * h) * -1) + 'px';
}
s.options.onChange = function(value){
f(value);
};
s.options.onSlide = function(value){
f(value);
};
There are three things that you have to pay attention to in the above
code snippet: ‘thumb’, ‘track’, and ‘innerDiv’ are all placeholders
for the actual names that you give to the parts in your Freeway layout.
Draw a layered HTML box (Blue CSS Button ON) that is the size of the
area you want to have scroll. Set that box to have Overflow: Hidden
in the Inspector. Next to that box, draw a thin box which will be the
track, and within that track, draw a nested or child box which will
be the thumb – the thing you move to make the effect work. Finally,
draw another box the same width as your scrolling window area, and
fill it with the content you want to have scroll.
Once you have done this, click and drag the tall box, then press the
spacebar as you bring the point of your cursor over the top of your
small scroll window. You will see a blue highlight rectangle form
around the edges of the scroll window, and at that moment you can
release the mouse. You will probably see an alert dialog that the
element you are dropping is too tall for the box. Okay it, then undo
the change to your layout by restoring the original dimensions using
the Inspector. Also use the Inspector to change the top-left of the
inner DIV to 0,0 and remove its height property by pressing the
button to the left of the Height value.
You will note that the inner box content flops out of the outer box
in the design view. There doesn’t seem to be anything you can do
about that, but if you preview at this point, you will see that it
doesn’t appear in the browser.
Apply Protaculous to the page, select scriptaculous-packed from the
Library picker, and click the top Function Body button in the Actions
palette. Paste the code from above (actually, just download the demo
– there are way too many things that can go wrong when e-mailing code).
As long as your elements are named the same way as the code expects
them to be, the example will just work.
If you want to have more than one such element on the page, then
simply copy and paste the entire code block within the Function Body
dialog, so that there are two instances of it, and change the
placeholders to reflect the names of your second through nth
instances of the effect.
Each scrolling area will need a uniquely named track, thumb, and
innerDiv. Everything else is taken care of for you.
Walter
On Apr 3, 2008, at 9:54 AM, shybuckstudio wrote:
Has there been any word on an update for the scroll-bar tut…I’m
very anxious to apply this to my web site!
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options