here's a stab.

use it the same as the link wrt the html/css, and then
$("#mydiv").DragPane({}); or
$("#mydiv").DragPane({ invert: true }); if the backwardness of it is
annoying to you.

leaving off the scrollbars would be a matter of styling the #myDiv
node overflow:hidden

jQuery.fn.DragPane = function(args){
    return this.each(function(){

                var invert = (args ? (args.invert || false) : false;
                var mod = invert ? -1 : 1;                              
                
                var m = {
                        
                        _down:function(e){
                                $(this).css("cursor","move");
                                m._x = e.pageX;
                                m._y = e.pageY;
                                var t = this;
                                if ((m._x < t.offsetLeft + t.clientWidth) &&
                                        (m._y < t.offsetTop + t.clientHeight)) {
                                        $(this).bind("mousemove",m._move);      
                                }
                        },
                        
                        _up: function(e){
                                $(this).css("cursor","pointer");
                                $(this).unbind("mousemove",m._move);
                        },
                        
                        _move: function(e){
                                this.scrollTop += (m._y - e.pageY) * mod;
                                this.scrollLeft += (m._x - e.pageX) * mod;
                                m._x = e.pageX;
                                m._y = e.pageY;
                        }
                };
                
                $(this).mousedown(m._down);
                $(this).mouseup(m._up);
                
    });
};

Regards,
Peter Higgins

On Jan 24, 2008 9:52 AM, bradrice <[EMAIL PROTECTED]> wrote:
>
> Is there a plug-in or some jQuery code I can use to make a draggable
> scroll image, similar to the scriptaculous effect of this:
> http://wiki.script.aculo.us/scriptaculous/show/DragScrollable?
>
> Brad
>

Reply via email to