Header Ads Widget

Responsive Advertisement

Widget Blog Pesawat Terbang Di Blog


Widget blog pesawat terbang ini berisi tentang pesawat terbang yang melayang-layang di halaman blog. Pada artikel ini saya berikan script yang sudah jadi siap pasang. Apabila ingin merubah gambar pesawat ataupun di modifikasi menjadi tampilan iklan baik untuk sponsor maupun menggunakan iklan biasa monggo silakan diutak-atik aja scriptnya. Gimana sob, widget ini makin kreatif kan ??? hehehe kerenkan.. nahh seperti biasa langsung ke TKP aja buat yang tertarik, cara pemasangan gampang tinggal copy paste aja kode scriptnya dan taruh dimana sobat suka, bisa di widget/gadget, template blog atau postingan artikel...suka-suka sobatlah.

Penting !!! ada baiknya sobat blogger mem-backup terlebih dahulu template blog sobat untuk menghindari  hal-hal yang tidak diinginkan dalam menerapkan widget ini.

Cara Pemasangan :
  • Login ke blog sobat...

  • Klik "More Options" selector box kemudian klik "Tata Letak" setelah itu pilih "Add Widget" dan pilih "HTML / Javascript", seperti gambar di bawah ini.





  • Copy-paste kode di bawah ini dan taruh di kotak gadget blog. Silakan sesuaikan beberapa parameter kode tersebut agar sesuai dengan tema blog sobat.
    <script>
    /*Created by MonozCore (2015) http://monozcore.blogspot.com*/
    var floatr = new Array();
    floatr[0] = "http://4.bp.blogspot.com/-LQPVA5_3JQk/VUQ1-sbEyfI/AAAAAAAAGhE/ZmIgp2Q1g1k/s1600/boeing747.png";
    var speedPic = 10;
    var ns4up = (document.layers) ? 1 : 0;  
    var ie4up = (document.all) ? 1 : 0;
    var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
    var dxPic, xpPic, ypPic, amPic, stxPic, styPic, picStopSet_NS6, picStopSet_ie4; 
    var iPic, doc_width = 800, doc_height = 1800;
    if (ns4up||ns6up) {
            doc_width = self.innerWidth;
            doc_height = self.innerHeight;
    } else if (ie4up) {
         doc_width = document.body.clientWidth;
            doc_height = document.body.clientHeight;
    }
    dxPic = new Array();
    xpPic = new Array();
    ypPic = new Array();
    amPic = new Array();
    stxPic = new Array();
    styPic = new Array();
    jPic = 0;
    var newImg = new Image();
    newImg.src = floatr[0];
    var imgWidth  = newImg.width;
    var imgHeight = newImg.height;
    for (iPic = 0; iPic < floatr.length; ++ iPic) {
            dxPic[iPic] = 0;                       
            xpPic[iPic] = Math.random()*(doc_width-50); 
            ypPic[iPic] = doc_height - imgHeight;
            amPic[iPic] = Math.random()*20;  
            stxPic[iPic] = 2 + Math.random(); 
            styPic[iPic] = 0.02 + Math.random()/10;     
            if (ns4up) {                      
                    if (iPic == 0) {
                            document.write("<layer name=\"dot"+ iPic +"\" left=\"15\" top=\"15\" visibility=\"show\"><a href=\"http://monozcore.blogspot.com\" style=\"text-decoration:none;cursor:help;\" target=\"blank\"><img src=\""+ floatr[jPic] + "\" border=\"0\"></a></layer>");
                    } else {
                            document.write("<layer name=\"dot"+ iPic +"\" left=\"15\" top=\"15\" visibility=\"show\"><a href=\"http://monozcore.blogspot.com\" style=\"text-decoration:none;cursor:help;\" target=\"blank\"><img src=\""+ floatr[jPic] + "\" border=\"0\"></a></layer>");
                    }        } else if (ie4up||ns6up) {                if (iPic == 0) 
    {
                            document.write("<div id=\"dot"+ iPic +"\" style=\"POSITION: fixed; Z-INDEX: "+ iPic +"VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://monozcore.blogspot.com\" style=\"text-decoration:none;cursor:help;\" target=\"blank\"><img src=\"" + floatr[jPic] + "\" border=\"0\"></a></div>");
                    } else {
                            document.write("<div id=\"dot"+ iPic +"\" style=\"POSITION: fixed; Z-INDEX: "+ iPic +"VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://monozcore.blogspot.com\" style=\"text-decoration:none;cursor:help;\" target=\"blank\"><img src=\"" + floatr[jPic] + "\" border=\"0\"></a></div>");
                    }
            }
            if (jPic == (floatr.length-1)) { jPic = 0; } else { jPic += 1; }
    }
    
    function floatrNS() {  
            for (iPic = 0; iPic < floatr.length; ++ iPic) {  
                    xpPic[iPic] += stxPic[iPic];
        if (ypPic[iPic] > doc_width-1) {
                            xpPic[iPic] = -imgWidth;
                            ypPic[iPic] = Math.random()*(doc_height-amPic[iPic]-30);
                            stxPic[iPic] = 2 + Math.random();
                            styPic[iPic] = 0.2 + Math.random()/10;
                            doc_width = self.innerWidth+imgWidth;
                            doc_height = self.innerHeight-imgHeight;                }
                    dxPic[iPic] += styPic[iPic];
                    document.layers["dot"+iPic].top = ypPic[iPic]+"px";
                    document.layers["dot"+iPic].left = xpPic[iPic] +"px";
            }
            picStopSet_ie4 = setTimeout("floatrNS()", speedPic);
      picStopSet_ie4;
    }
    
    function floatrIE_NS6() {
            for (iPic = 0; iPic < floatr.length; ++ iPic) { 
              xpPic[iPic] += stxPic[iPic];
                    if (xpPic[iPic] > doc_width-1) {
                            xpPic[iPic] = -imgWidth;
                            ypPic[iPic] = Math.random()*(doc_height-amPic[iPic]-30);
                            stxPic[iPic] = 2 + Math.random();
                            styPic[iPic] = 0.2 + Math.random()/10;
                            doc_width = ns6up?window.innerWidth+imgWidth:document.body.clientWidth;
                            doc_height = ns6up?window.innerHeight-imgHeight:document.body.clientHeight;
                    }
        
                    dxPic[iPic] += styPic[iPic];
        if (ie4up){
        document.all["dot"+iPic].style.pixelTop = ypPic[iPic]+document.body.scrollTop;
                    document.all["dot"+iPic].style.pixelLeft = xpPic[iPic] +"px";
                    }
                    else if (ns6up){
     document.getElementById("dot"+iPic).style.top=ypPic[iPic]+"px";
     document.getElementById("dot"+iPic).style.left=xpPic[iPic] +"px";
                    }
            }
      picStopSet_NS6 = setTimeout("floatrIE_NS6()", speedPic);
      picStopSet_NS6;
      }
    
    if (ns4up) {
            floatrNS();
    } else if (ie4up||ns6up) {
            floatrIE_NS6();
    }
    
    function stopFlyPic(){
     if (ns4up) {
            clearTimeout(picStopSet_ie4);
    } else if (ie4up||ns6up) {
            clearTimeout(picStopSet_NS6);
    }}
     
    function startFlyPic(){
     if (ns4up) {
            floatrNS();
    } else if (ie4up||ns6up) {
            floatrIE_NS6();
    }
    }
    </script>
    

  • Klik "Save" dan lihat hasilnya...
Oke sobat MonozCore terima kasih sudah berkunjung ke blog MonozCore jangan lupa Like, Share dan Subscribe ... happy blogging... Apabila berkenan silakan tuliskan sepatah atau dua patah kata di kotak komentar.

.: Semoga Bermanfaat :.

Post a Comment

0 Comments