How can I avoid floating the same content twice?
- by Randall Bohn
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?