hey Mona,

i tried removing the css on the div but the effect still did not work.
Here's all the code im using for this..

posts/show.html.erb
...
<div class="gform">
        <%=     render :partial => "comments" %>
</div>
...

comms div/comments partial
<div class="form" style="display:none" id="comments-section">
        <div>
                <div id="comments" >
                        <% @comments.each do |c| %>
                                <%= render :partial => "comment", :locals => 
{:c => c} %>
                        <% end %>
                </div>
                <br/>
                <% form_remote_for @comment, :html => {:id => "comment_form"} 
do |f|
%>
                  <%= error_messages_for :object => @comment, :header_message =>
nil, :message => nil %>
                  <%= f.text_area :content, :rows => 4 %>

                  <%= f.hidden_field :post_id, :value => @post.id %>

                  <%= f.hidden_field :author_id, :value => params[:user_id] %>

                  <%= f.hidden_field :author_type, :value => "User" %>

                  <br/><p><%= f.submit "Add Comment" %></p>
                <% end %>
                <div style="float:right;">
                        <%= link_to_function "Close", "toggle_comments();"%>
                </div>
        </div>
</div>

comment partial

<div id="comment">
<br/>
        <%= c.owners_full_name%> : <%= c.content %>
<hr/>
</div>

CSS
.gform {
                width : 810px;
       line-height: 20px;
                margin: 0 auto;
}
.form {
       padding: 1em;
       border: 0px;
       font: 90% "Lucida Grande", "Trebuchet MS", Verdana, sans-serif;
       background: #F4FECA;
 }

Hope i covered everything. thanks for the response!
On Apr 22, 6:24 pm, Mona Remlawi <[email protected]> wrote:
> most likely it's related to the content of what you are trying to
> apply the effect on.
> I tried your example, works fine on FF & IE6.
> Can you provide more info related to css you apply to div#comms
>
> cheers
>
> --
> mona
> [email protected]
>
> On Wed, Apr 22, 2009 at 2:24 PM, Ram <[email protected]> wrote:
>
> > spawning off other JS functions?
> > nope..
> > I read about how effects queue up and so i need to actually do
> > new Effect.toggle('comms', 'slide');
> > instead of just
> > Effect.toggle('comms', 'slide'); (which was what i was doing before)
>
> > But that makes no difference.
> > It cant be a browser issue because the demos of these effects on the
> > scriptaculous wiki work on the same browser.
>
> > On Apr 22, 5:17 pm, Brendan O Connor <[email protected]> wrote:
> >> are you spawing of other javascript functions at the same time
>
> >> 2009/4/22 Ram <[email protected]>
>
> >> > Anyone? Any thoughts at all?
>
> >> > On Apr 21, 3:40 pm, Ram <[email protected]> wrote:
> >> > > Hi all,
>
> >> > > I have an RoR app in which Im using Effect.toggle('id', 'slide') to
> >> > > show and hide a div.
>
> >> > > However, the actual effect of sliding does not show (neither do
> >> > > 'blind' or 'appear'). Instead, there is a delay (of approximately the
> >> > > time that the effect might take) and the div is just displayed
> >> > > abruptly. The same happens when I toggle it again to hide it too.
>
> >> > > The effects were working a few months back. I have changed a lot in
> >> > > the meanwhile in the app as a whole but I dont see why that should
> >> > > cause this problem to arise. The code im using is this..
>
> >> > > erb template
> >> > > <%= link_to_function image_tag("/images/comments_y2.jpg"),
> >> > > "toggle_comments();" %>
>
> >> > > application.js
> >> > > function toggle_comments() {
> >> > >         new Effect.toggle('comms', 'slide');
> >> > >         return false;
>
> >> > > }
>
> >> > > comms div
> >> > > <div class="form" style="display:none" id="comms">
> >> > >         <div>
> >> > >                 <div id="comments" >
> >> > >                         ...
> >> > >                 </div>
> >> > >                 <br/>
> >> > >                 <% form_remote_for ... %>
> >> > >                   ...
> >> > >                 <% end %>
> >> > >                 <div style="float:right;">
> >> > >                         <%= link_to_function "Close",
> >> > "toggle_comments();"%>
> >> > >                 </div>
> >> > >         </div>
> >> > > </div>
>
> >> > > Could anyone tell me where im breaking the effect?
> >> > > Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to