Sunday, August 26, 2012
Blogging dimana-mana, ada yg menarik nih yaitu ToolTips Yang Menjangkau Semua Link, Jadi Tooltips Ini Bukan Hanya, Menjangkau Bagian Menu, Tapi Juda Post, Widget Dan Lain2 Asalkan diberikan title, itu beda nya sama tooltip lain, tooltips ini cuma di masukan satu kali, contoh arah kan cursor diiiiisiniiiiii kgk usah basa-basi langsung aja :

Letakan code berikut di atas Code </body> :



<script type="text/javascript">
//<![CDATA[
// Pure JavaScript Nested Tooltip Replacement for all Anchor Tag
// https://plus.google.com/108949996304093815163/about
(function() {

    var a = document.getElementsByTagName('a');
    var t = document.createElement('span');
        t.id = "tt";
        t.style.position = "absolute";
        t.style.zIndex = 999;
        t.style.backgroundColor = "#FFE13F";
        t.style.border = "1px solid #BC5F05";
        t.style.font = "bold 11px Tahoma,Arial,Sans-Serif";
        t.style.boxShadow = "0 1px 3px rgba(0,0,0,0.4)";
        t.style.padding = "5px 10px";
        t.style.color = "#000";
        t.style.maxWidth = "170px";
        t.style.wordWrap = "break-word";
        t.style.display = "none";
    document.body.appendChild(t);
    var tooltip = document.getElementById('tt');

    function over(e) {
        tooltip.style.display = "block";
        tooltip.innerHTML = this.title;
        tooltip.style.top = (e.pageY + 25) + 'px';
        tooltip.style.left = e.pageX + 'px';
        this.setAttribute('original', this.title);
        this.title = "";

    }

    function out() {
        tooltip.innerHTML = "";
        tooltip.style.display = "none";
        this.title = this.getAttribute('original');
        this.removeAttribute('original');
    }

    for (var i = 0; i < a.length; i++) {
        if (a[i].title) {
            a[i].onmouseover = over;
            a[i].onmouseout = out;
        }
    }

})();
//]]>
</script>
udah selesai ?, ya iyalah emang mau gw tambah-tambahin, utk warna sama background edit sendiri ya, masak gtu aja kgk bsa.

Sumber Script : DTE

1 comment:

  1. Wah Nice Harus Di Coba Nh
    Kunjungan Antar Friend : http://itcxgresida.blogspot.com/

    ReplyDelete

1. No Junk, Sara, Sejenisnya lah.
2. Jgn Spam Sana, Spam sini.
3. Jgn Promosi, Blog, Rumah,Hp, Mobil, Obat2-an, Lain2.
4. Jangan Ngebacot, Ngebacot Di CeBOX Aja.
5. Sempat2lah berkomentar, Gk Pake Captha