Forum: Ruby on Rails how to overlap some text with a div on toggle?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Patrick Aljord (Guest)
on 2007-01-19 16:30
(Received via mailing list)
Hey all,

I use a toggle effect this way:

<%= link_to_function "edit this item", "Element.toggle('editdiv')" %>
<div id="editdiv" style="display:none">
blabla <br>
blabla <br>
blabla <br>
blabla <br>
</div>
<br>
roror <br>
roror <br>
roror <br>


that works great but I would like the content of editdiv to overlap
the text that comes next, in other words I want blabla to overlap
roror because for now, when I click on "edit this item"
, roror goes down  to make room for blabla.
Any idea how to do this?

thanx in advance

Pat
81504fa8749b074222e5eb9dbcaf7e50?d=identicon&s=25 Tobias G. (tobias)
on 2007-01-19 16:31
(Received via mailing list)
Patrick Aljord schrieb:
> the text that comes next, in other words I want blabla to overlap
> roror because for now, when I click on "edit this item"
> , roror goes down  to make room for blabla.
> Any idea how to do this?
>

For overlapping you must use the z-index css property and the div must
have an absolute position.

Tobias
Patrick Aljord (Guest)
on 2007-09-25 22:45
(Received via mailing list)
ok thanx a lot.
I came up with something like this:
<div id="editdiv" style="display:none;position:absolute;
background-color:white;    z-index: 1; ">
blabla <br>
blabla <br>
blabla <br>
blabla <br>
</div>
<div id="editdiv" style="position:absolute;z-index: -1;">
roror <br>
roror <br>
roror <br>
</div>
This topic is locked and can not be replied to.