Ruby on Rails Tuesday, June 1, 2010

I have the following code:

----

<div id="order">

<ul>

<% @orders.reverse.each do |order| %>

<li><%= link_to_remote( "#{order.id} #{order.name}" , :url =>
{:controller => 'orders', :action => 'show', :id => order.id }, :update
=> "order_div", :method => 'get' ) %></li>

<% end %>

</ul>

</div>

----

I want to create a button or link to scroll these order items by 5 at a
time. So it should display the first 5 by default. I will then be able
to click a button below and it should scroll the next 5, hiding the
previous.

I know this is a tall order. I've been looking into a lot of slider
plugins. None of them do what I want. Most of them only scroll content
one item at a time. The closest thing I used was easySlider (jQuery).
Cool plugin, but I didn't know how to adapt it to scroll by 5 items at a
time. Plus, it messed up my css formatting and the items went all wonky
each time I clicked the button to scroll to the next item.

I'm using (for now) jQuery, Prototype, and Script.aculo.us. I'm running
different things from each JS library in separate parts of my app (to
get a feel for what I want to use), so any help to do this kind of thing
in any of these libraries will be much appreciated. I'm not stuck to one
or the other. Thanks!
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment