This is a message.

A vertical scrollable

Here we show you a vertical setup for a scrollable. There is a minor change compared to the minimal setup and it's recommended that you study that first before continuing. This scrollable has 4 elements in total and each element has 3 rows that are shown at a time. You can scroll these elements by:

  1. Clicking on the "more pictures" link.
  2. Using the up and down arrow keys.
  3. Using your mousewheel.

1. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

2. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

3. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

4. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

5. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

6. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

7. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

8. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

9. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

10. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

11. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

12. Barcelona Pavilion

The German Pavilion in Barcelona, designed by Ludwig Mies van der Rohe and built for the International Exposition in 1929.

The Pavilion was not only a pioneer for construction forms with a fresh, disciplined understanding of space, but also for modeling new opportunities for an exciting association of free art and architecture.

Read more   Show in map

standalone demo

HTML code

Our HTML structure is identical to the one presented in the "minimal setup" except that the items that are scrolled are more complex than just a single image. Also, the navigational buttons have been placed inside a wrapping DIV.

  <div id="actions">
<a class="prev">&laquo; Back</a>
<a class="next">More pictures &raquo;</a>
</div>
 
<!-- root element for scrollable -->
<div class="scrollable vertical">
 
<!-- root element for the scrollable elements -->
<div class="items">
 
<!-- first element. contains three rows -->
<div>
 
<!-- first row -->
<div class="item">
 
<!-- image -->
<img src="http://path/to/my/image.jpg" />
 
<!-- title -->
<h3>1. Barcelona Pavilion</h3>
 
<!-- content -->
<p>
The Pavilion was not only a pioneer ...
</p>
 
</div>
 
<!-- 2:nd and 3:rd rows -->
<div class="item"> ... </div>
<div class="item"> ... </div>
 
</div>
 
<!-- second element with another three rows (and so on) -->
<div>
...
</div>
 
</div>
 
</div>

HTML

CSS code

We have used the following CSS file for the above setup. Here are the crucial parts from the CSS file that are required for a vertical scrollable:

  /* root element for scrollable */
.scrollable {
 
/* required settings */
position:relative;
overflow:hidden;
 
/*
vertical scrollables have typically larger height than width but
not now
*/
height: 665px;
width: 700px;
}
 
/* root element for scrollable items */
.scrollable .items {
position:absolute;
 
/* this time we have very large space for the height */
height:20000em;
}

CSS

Note: in a horizontal scrollable the items are floating side by side by using the float: left property. In vertical scrollables this is not necessary.

JavaScript code

The scrollable is good at guessing whether its vertical or horizontal by investigating it's width and height. If the height is larger than width then the scrollable is vertical. This can also be manually configured with the vertical property which overrides the automatic determination.

We use the mousewheel configuration to enable scrolling with the mousewheel. You need to make sure that mousewheel tool is included on your page.

$(function() {
// initialize scrollable with mousewheel support
$(".scrollable").scrollable({ vertical: true, mousewheel: true });
});

JavaScript

Note: this mousewheel tool is not included in the standard jQuery Tools distribution. You must download a custom combination that includes this tool.

Photo credits »