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.
<% 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
ask.
- thanks in advance.