diff options
author | 2010-01-24 14:33:28 +0100 | |
---|---|---|
committer | 2010-01-24 14:33:28 +0100 | |
commit | 27b23bc15985aea687aecec580d668b7f9701eb3 (patch) | |
tree | b82659a8350c09d85e85e74af639ee909892d37e /examples/data/scripts/hint.js | |
parent | 6d4547a49805b552e9b56d41a653a0912e7b0534 (diff) | |
parent | c8fb24d1069aa776bccdf3141adb9d3c3f6e8101 (diff) |
merge in experimental
Diffstat (limited to 'examples/data/scripts/hint.js')
-rw-r--r-- | examples/data/scripts/hint.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/data/scripts/hint.js b/examples/data/scripts/hint.js new file mode 100644 index 0000000..ec7f1e2 --- /dev/null +++ b/examples/data/scripts/hint.js @@ -0,0 +1,26 @@ +for (var i=0; i < document.links.length; i++) { + var uzblid = 'uzbl_link_hint_'; + var li = document.links[i]; + var pre = document.getElementById(uzblid+i); + + if (pre) { + li.removeChild(pre); + } else { + var hint = document.createElement('div'); + hint.setAttribute('id',uzblid+i); + hint.innerHTML = i; + hint.style.display='inline'; + hint.style.lineHeight='90%'; + hint.style.backgroundColor='red'; + hint.style.color='white'; + hint.style.fontSize='small-xx'; + hint.style.fontWeight='light'; + hint.style.margin='0px'; + hint.style.padding='2px'; + hint.style.position='absolute'; + hint.style.textDecoration='none'; + hint.style.left=li.style.left; + hint.style.top=li.style.top; + li.insertAdjacentElement('afterBegin',hint); + } +} |