m3tsys
m3tsys

Reputation: 3969

jQuery scroll image vertically inside div

I try to make a bigger photo than the div that is containing it to auto scroll vertically.

Also found a nice jQuery plugin jQuery simplyScroll but i can't make it run properly.

Here is my fiddle.

(function($) {
        $(function() { //on DOM ready
            $("#scroller").simplyScroll({
                customClass: 'vert',
                orientation: 'vertical',
                auto: true,
                manualMode: 'end',
                frameRate: 8,
                speed: 5
            });
        });
    })(jQuery);

It doesn't scroll to bottom. What i did wrong?

Upvotes: 2

Views: 2393

Answers (2)

NubPro
NubPro

Reputation: 515

https://jsfiddle.net/h5Lrq9zy/2/

.vert .simply-scroll-clip {
    width: 400px;
}
.vert .simply-scroll-list li {
    width: auto;
    height: auto;
}

Too much hardcoded stuff within the plugin itself. A terrible plugin overall, but yes, you could modified it to be better.

Upvotes: 2

mccannf
mccannf

Reputation: 16659

You specified a custom class to use as a container called vert.

So you need to specify CSS for that class like so:

.vert { 
    width: 400px; /* wider than clip for custom button pos. */
    height: 1000px;
    margin-bottom: 1.5em;
}

/* Clip DIV */
.vert .simply-scroll-clip {
    width: 400px;
    height: 1000px;
}

/* Explicitly set height/width of each list item */
.vert .simply-scroll-list li {
    width: 400px;
    height: 1000px;
}

Fiddle here.

Upvotes: 2

Related Questions