ページを見ながらdel.icio.usにブックマーク

del.icio.usブックマークレットは実行するとページが変わってしまうので、
もとページがみられなくなってしまう。
コメントを必ず書くようにしているので、もとページをみながらブックマークをしたい。


もともとのブックマークレットを少し改造して、
ページの一番下にiframeでdel.icio.usのページを読み込むようにした。
ブックマークした後がださいんだけど、それは我慢。

javascript:(function(){var ifr = document.createElement('iframe');ifr.width = '100%';ifr.height = '800px';ifr.src='http://del.icio.us/post?v=4;url='+encodeURIComponent(location.href)+';title='+encodeURIComponent(document.title);document.body.appendChild(ifr)})();


まえ、BlueDotを少し使ったときにブックマークレットがよくできていて、
そういうのを作ろうかと思ったんだけど、いろいろ作ってるうちに面倒なことが分かってきて断念。


今書きながら気づいたけど、外国のサイトで探したらいいのあるかも。


※追記
position:fixedなdivを使ったバージョン。

javascript:(function(){var dummy = document.createElement('div');dummy.style.height = '310px';var div = document.createElement('div');with (div.style) {position = 'fixed';width = '100%';height = '300px';top = window.innerHeight - 310 + 'px';left = '0px';zIndex = 1000;}var ifr = document.createElement('iframe');ifr.style.width = '100%';ifr.style.height = '100%';ifr.src = 'http://del.icio.us/post?v=4;url='+encodeURIComponent(location.href)+';title='+encodeURIComponent(document.title);div.appendChild(ifr);document.body.appendChild(dummy);document.body.appendChild(div);})();

※追記
closeボタン付き

javascript:(function(){var dummy=document.createElement('div');dummy.style.height='310px';var div=document.createElement('div');with(div.style){position='fixed';width='100%';height='300px';top=window.innerHeight-310+'px';left='0px';zIndex=1000;backgroundColor='#555';border='1px solid #000';textAlign='center';color='#fff';}var ifr=document.createElement('iframe');ifr.style.width='100%';ifr.style.height='285px';ifr.style.border='0px';ifr.src='http://del.icio.us/post?v=4;url='+encodeURIComponent(location.href)+';title='+encodeURIComponent(document.title);var p=document.createElement('p');p.innerHTML='close';with(p.style){height='15px';margin='0px';padding='0px';border='0px';fontSize='12px';fontWeight='bold';}p.onclick=function(){document.body.removeChild(div);document.body.removeChild(dummy);};div.appendChild(p);div.appendChild(ifr);document.body.appendChild(dummy);document.body.appendChild(div);})();

※追記

こっちにまとめました。
http://swdyh.infogami.com/layered_del.icio.us_bookmarklet