Drag-Drop Widget Hack untuk Blogger
October 24, 2008 by Adam Pahlevi
Filed under Google Blogger

Pernah mencoba ngeposting menggunakan WordPress 2.5 kebawah?
Maka anda akan bisa menggeser sesuka hati elemen-elemen yang berbentuk seperti Widget itu sesuka hati anda. Semisal anda ingin menggeser widget Publish di WordPress 2.5, ya tinggal di klik biasa header widgetnya, lalu di tahan, dan di geser menuju arah yang diinginkan.
Contoh lainnya di samping blog ini. Blog ini beralamatkan di sini nih. Tapi blognya makek bahasa gak jelas, mungkin bahasanya alien.
Yawdah, karena terinspirasi oleh WordPress, juga terinspirasi oleh blog si alien. Maka Blogywalkie, mumpung, belum ada yang melakukan hack ini, akan dengan senang hati akan membuatkannya untuk orang-orang setia Blogywalkie. Makanya, join komunitas Feedburnernya Blogywalkie donk. Kan gampang, tinggal klik ini doank. Hoho, promosi.
Yawda, caranya aslinya simple, n gampang banget kok. Hanya saja ini syaratnya nih:
- Menyiapkan kembang tujuh rupa segala warna dari rumah mak erot
- Blog harus Blogger (ya eyalah, penting tah di beritahu?) Hoho
- Widget tidak boleh ter-’kontaminasi’ hack dari Bloggeruniversity: Expandable Blogger Widget. Gak tahu kenapa, pokoknya gak bisa gitu. Udah w coba kok, tetep aja kok ndak bisa
/**************************************************************** Docking Boxes core CSS: Blogywalkie.com *****************************************************************/ .dbx-clone { position:absolute; visibility:hidden; } .dbx-clone, .dbx-clone .dbx-handle-cursor { cursor:move !important; } .dbx-dummy { display:block; width:0; height:0; overflow:hidden; } .dbx-group, .dbx-box, .dbx-handle { position:relative; display:block; } /**************************************************************** setting padding, dan margin *****************************************************************/ .dbx-box { position:relative; margin:0; padding:0; border:none; clear: both; z-index:1000; } /**************************************************************** otherwise, do what you like :) *****************************************************************/ /* group container(s) */ .dbx-group {} /* handles */ .dbx-handle { z-index:1000; } /* handle cursors are in a class of their own so they only get applied if the script is supported */ .dbx-handle-cursor { cursor:move; } /* toggle images */ a.dbx-toggle, a.dbx-toggle:visited { display:block; width:18px; height:19px; overflow:hidden; position:absolute; background:none; top:6px; right:23px; text-indent:-50px; text-decoration:none; } a.dbx-toggle-open, a.dbx-toggle-open:visited { background:none; } a.dbx-toggle-closed, a.dbx-toggle-closed:visited { background:none; } a.dbx-toggle-hilite-open, a.dbx-toggle-hilite-open:visited { background:none; } a.dbx-toggle-hilite-closed, a.dbx-toggle-hilite-closed:visited { background:none; } /* keyboard navigation tooltip */ .dbx-tooltip { display:block; position:absolute; margin:36px 0 0 125px; width:185px; border:1px solid #000; background:#ffd; color:#000; font:normal normal normal 0.85em tahoma, arial, sans-serif; padding:2px 4px 3px 5px; text-align:left; } * html .dbx-tooltip { width:176px; } /* use CSS2 system colors in CSS2 browsers but not safari, which doesn't support them */ *[class="dbx-tooltip"]:lang(en) { border-color:InfoText; background:InfoBackground; color:InfoText; font:small-caption; font-weight:normal; } /* inner content area */ .dbx-content { position:relative; overflow: hidden; width:183px; } /* toggle state of inner content area */ .dbx-box-closed .dbx-handle {} .dbx-box-closed .dbx-content { display:block; height:0px; overflow:hidden; } .dbx-box-closed .dbx-content * { display:none !important; } /* additional clone styles .dbx-clone { opacity:0.8; -moz-opacity:0.8; -khtml-opacity:0.8; filter:alpha(opacity=80); } */
Lalu, setelah kode ]]</b:skin> tersebut, tambahkan kode JavaScript ini, dibawahnya tentunya :D
<!--[if IE]> <!--[if IE]> <style type="text/css"> #sidebar .Label a.dbx-toggle, #sidebar .Label a.dbx-toggle:visited {top:30px !important; right:20px !important;} </style> <![endif]--> <!-- Sidebar docking boxes (dbx) by Brothercake - http://www.brothercake.com/ --> <script src='http://www.webpagedesign.ws/jeans2c/dbx.js' type='text/javascript'/> <script type='text/javascript'> function dbxInitiate(gid){ container = document.getElementById(gid); if(container == null) { return; } eles2 = container.getElementsByTagName('h2'); for(var i=0;i<eles2.length;i++){ eles2[i].className = 'dbx-handle'; }; eles = container.getElementsByTagName('div'); for(var i=0; i<eles.length; i++){ if(eles[i].className == 'widget-content'){ eles[i].className = 'dbx-content'; } if(/widget/i.test(this.eles[i].className)){ eles[i].className += ' dbx-box'; } }; }; window.onload = function() { dbxInitiate('sidebar'); //initialise the docking boxes manager var manager = new dbxManager('main'); //session ID [/-_a-zA-Z0-9/] //create new docking boxes group var sidebar1 = new dbxGroup( 'sidebar', // container ID [/-_a-zA-Z0-9/] 'vertical', // orientation ['vertical'|'horizontal'] '7', // drag threshold ['n' pixels] 'no', // restrict drag movement to container axis ['yes'|'no'] '10', // animate re-ordering [frames per transition, or '0' for no effect] 'yes', // include open/close toggle buttons ['yes'|'no'] 'open', // default state ['open'|'closed'] 'open', // word for "open", as in "open this box" 'close', // word for "close", as in "close this box" 'click-down and drag to move this box', // sentence for "move this box" by mouse 'click to %toggle% this box', // pattern-match sentence for "(open|close) this box" by mouse 'use the arrow keys to move this box', // sentence for "move this box" by keyboard ', or press the enter key to %toggle% it', // pattern-match sentence-fragment for "(open|close) this box" by keyboard '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts ); }; </script>
Sekarang, tinggal satu langkah mudah. Temukan kode berikut ini:

PentingKah? on Sat, 25th Oct 2008 8:03 pm
eh… ternyata, caranya segampang ini yah mas?
PentingKah? on Sat, 25th Oct 2008 8:04 pm
eh… ternyata, caranya segampang ini yah mas?