DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Display Images In Separate Div On Mouseover Of List Entry

  • submit to reddit
        Exerpt of prog to handle images from 35mm film. Main admin page displays a table of films. On mouseover of each row  thumbnails of the pictures in that film are displayed in a separate div. 
Exerpt of list.rhtml 
<tr id="tablerow<%= %> " onMouseover="<%= remote_function(:update => "preview",  :url => { :action => :preview ,  :id =>})%>;">

Exerpt of controller.rb
  def preview
    @pictures = Picture.find(:all, :conditions => ["roll_id = #{params[:id]} "])
    render(:partial => "preview")

<% for picture in @pictures%>
<img src= <%= picture.thumb_url %> alt= <%= picture.thumb_url %> height=60 >
<% end %>


Snippets Manager replied on Thu, 2010/05/06 - 12:43pm

Hello I would like to do the same using Low Pro ( ) But I can't because my list is in a partial and is not loaded when you load the page but after clicking some button. So the javascript doesn't applies to the concerned div in the partial... Have any idea of a way to solve that problem? Thanks