Ian Tyndall wrote:
Ian Tyndall wrote:
I'm currently working on a method to implement a scroller for a div
using a slider. I need to do this as an alternative to making a
stylish flash scroller with content.
The main advantage of this method is to allow the ability to style
the sliding elements cross browser (and maybe as a future add on...
the ability to have a scroll.to for a scrolling div).
This is my first attempt at writing code the prototype way, so please
be gentle.
Any advice on my markup or approaching this will greatly be appreciated!
My two current examples:
http://knowmad.com/~ian/scroller/scroller_slide.html
http://knowmad.com/~ian/scroller/scroller_blind.html
I was originally wanting to use slide, but It spits out errors in
firebug:
effects.js (line 736)
<view-source:http://knowmad.com/%7Eian/scroller/effects.js>$(element.firstChild).getStyle
is not a function
Thanks,
Ian
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Ok,
I've got the slider working with Effect.Slide... sort of:
http://knowmad.com/~ian/scroller/scroller.html
Any recommendations will greatly be appreciated!
If you want me to post the js, please ask.
Ian
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Ok, here is the code:
Scroller = Class.create();
Scroller.prototype = {
initialize : function(handle, track, elem) {
var scroll_slider = new Control.Slider(handle,track,{axis:'vertical'});
scroll_slider.options.onSlide = function(v){
Scroller.scrollit(v, elem);
}
}
}
Object.extend(Scroller, {
scrollit : function(v, elem) {
scroll_inc = (v*100).toFixed();
$('debug2').innerHTML='slide: '+scroll_inc;
Effect.toggle(elem,'slide', { scaleTo: scroll_inc } );
}
}
Again, thanks in advance for any thoughts/experiences!
Ian
);
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs