I’m using link_to_remote to show details for an item that’s clicked. I’d
like to hide the div with the next click, or alternatively have a “Hide”
link within my div.
Just to add to Mike’s post, I’d look at the standard rails index.html as
it does that very thing with the about DIV.
A.
That’s exactly what I want to do, but unfortunately the standard
index.html doesn’t use rails to achieve its effect, it uses
scriptaculous directly in a std html file.
Just to add to Mike’s post, I’d look at the standard rails index.html as
it does that very thing with the about DIV.
A.
That’s exactly what I want to do, but unfortunately the standard
index.html doesn’t use rails to achieve its effect, it uses
scriptaculous directly in a std html file.
maybe try setting the display css attribute of the div to inline, ie:
since Element.toggle simply changes the display attribute from ‘inline’
to
‘none’, so it may have a problem if you don’t initially set any display
attribute.
Just to add to Mike’s post, I’d look at the standard rails index.html as
it does that very thing with the about DIV.
A.
That’s exactly what I want to do, but unfortunately the standard
index.html doesn’t use rails to achieve its effect, it uses
scriptaculous directly in a std html file.
maybe try setting the display css attribute of the div to inline, ie:
since Element.toggle simply changes the display attribute from ‘inline’
to
‘none’, so it may have a problem if you don’t initially set any display
attribute.
I have the same problem showing div item that its initial state is set
to ‘none’.
It seems that when the initial state is ‘none’, Element.toggle can’t
change it to ‘inline’.
what i did to solve the problem, is using the ‘onload’ event.
I’m starting by showing the div and then when the page loads, it uses
‘onload’ to switch to ‘none’, then the toggling works.
im working on this problem also. actually i sort of stuck where i load a
javascript behavior on :loading. i dont have the code in front of me,
but its something like newEffect.Highlight(‘somediv’#{obj.id})
the updating of the div works but doesnt load the effect.
thanks
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.