How can I avoid floating the same content twice?
Posted
by
Randall Bohn
on Stack Overflow
See other posts from Stack Overflow
or by Randall Bohn
Published on 2010-12-27T18:46:11Z
Indexed on
2010/12/27
18:53 UTC
Read the original article
Hit count: 330
My Kynetx app uses float_html()
to put up a box full of content.
rule float_box {
select when pageview ".*"
pre {
content = <<
<div id='messagebox'>
<h3>Floating Message Box</h3>
<ul id='my_list'></ul>
</div>
>>;
}
float_html("absolute","top:25px","right:20px",content);
}
rule fill_box {
select when pageview ".*"
foreach ["alpha","bravo","charlie"] setting (list_item)
append("#my_list", "<li>#{list_item}</li>");
}
The app (a421x27) is used from a bookmarklet. If you click the bookmarklet twice on the same page you get double content.
Is there any way to detect that the box is already on the screen and reuse it?
© Stack Overflow or respective owner