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.
<div class="home_news_highlight">
<div class="home_news_highlight_pic"><span></span>
<% 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 %>
</div>
<% id = 0 %>
<% for article in @all_articles %>
<p class="slideshow_text" id="article_summary_<%=
id.to_s %>"
style="<%= (article == @all_articles.first ? "":
"display:none;")
%>"></p>
<h1><%= link_to (article.name), :controller =>
"article", :action =>
"show", :id => article %></h1>
<%= article.date.strftime("%a %d %B") %>
<p><%= article.summary[0,75] %>...</p>
<% id += 1 %>
<% end %>
</div>
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.
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.