Fader Issues

What I want is to be able to fade an Image from a News Story with the
summary text. Both from the same record, from the same database table.
I’ve placed the fader into a seperate partial that’s being rendered on
an index page. I’ve included the proper javascript files in the proper
location and included them in my layout.

<% id = 0 %> <% for article in @all_articles %> <%= scale_image_tag article.picture1, :width => 137, :height => 153, :alt => article.picture1.image_alt, :id => "article_image_" + id.to_s, :style => (article == @all_articles.first ? "": "display:none;") %> <% id += 1 %> <% end %>
<% id = 0 %>

<% for article in @all_articles %>
<p class=“slideshow_text” id=“article_summary_<%= id.to_s %>”
style="<%= (article == @all_articles.first ? “”: “display:none;”)

<%= link_to (article.name), :controller => “article”, :action =>
“show”, :id => article %>

<%= article.date.strftime("%a %d %B") %>

<%= article.summary[0,75] %>…

<% id += 1 %>
<% end %>

The above is immediately run after the javascript declaration.
Basically, I’m getting the images to fade. Unfortunately, there are two
News Story records that are highlighted and the above code is displaying
the two, which is completely understandable after being passed through a
loop. But I want to know how I can retrieve all the News Stories that
are highlighted without displaying them and then making the page fade
the text too.

If you need any more information to respond, please don’t hesitate to

  • thanks in advance.

Came back to this. Problem solved.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs