views:

50

answers:

1

Hi!

I'd like to create a slider like in these image galleries.
It should show multiple entries at a time, as shown in the following image:

http://i.imgur.com/nTBPw.png (@ILMV sorry, I'm not allowed to place it by myself..)

When I click on the right arrow it should slide ("iPhone-like") to the left so that you see 5, 6, 7 and 8.
The entries (imaged by numbers) are created dynamicly.

<div>
    <ul>
        <li>1</li>  <!-- ← visible -->
        <li>2</li>  <!-- ← visible -->
        <li>3</li>  <!-- ← visible -->
        <li>4</li>  <!-- ← visible -->
        <li>5</li>  <!-- ← not visible -->
        <li>6</li>  <!-- ← not visible -->
        <li>7</li>  <!-- ← not visible -->
        <li>8</li>  <!-- ← not visible -->
    </ul>
</div>

I know how a slider works and would be able to create one by myself, but I can't figure how to create that (CSS-)layout..

Thank you in advance

EDIT to make that clear: the order is relevant because I'd like to build a "all of our customers" grid-like view, which are sorted by their titles.

A: 

The problem with your question is that you're unclear about whether you need the list elements in a particular order or not. Of course given you're already using jQuery there's no reason why you shouldn't be able to insert them in a manner which would be acceptable to you.

Anyway, I've created something simple with floats. Here's a simple demo: http://jsfiddle.net/vPGbf/

The crux of the whole thing (ignoring the really fancy CSS I've stuck in there) are some really simple floated li, a absolute positioned ol and a outer div with overflow set to hidden to hide the other lis which you don't need yet. That's really it. Remember that the ol's width have to be increased as you add in more elements, and that to do the sliding you should change the left value of the ol.

Yi Jiang
Adding to my answer above: here is a little example of the webseite: http://miux.ch/m1ux/grafik/ (still a "working draft")I've created something similar to your example (which is btw an interesting way to share code! I'll try that soon. Thank you!)But no matter how i change the code, it never shows up like I want it to :/I hope it helps you understand my question.
scherii
@scherii If you are asking for someone to help you debug your code I think it might be more appropriate to open another question, since that would be going outside the scope of this question.
Yi Jiang
I managed to create a solution with javascript/jQuery by wrapping every 8 elements in a div - I think this way it'll work as I though.Thanks for your help and your time! I apologize for that I wasn't able to ask what I really needed, I wasn't sure about it myself.If anyone needs to know how I did it, feel free to contact me.
scherii