ATTENTION !!

Kalau korang ada soalan atau pertanyaan , boleh message kat facebook MadNip atau di page MadNip.blogspot .. Sekian ..

Tuesday, July 12, 2011

Tutorial : Hide Shoutbox di sebelah

السلام عليكم

Bagi menjawab persoalan cik adik Syahirah Samn , cara nak hide shoutbox atau bahasa ringkas nya , Chatbox ( ringkas ke ?? Bantai je ) .. First sekali , korang mesti lah ada shoutbox ( korang buat lah shoutbox tu ok , aku dah tak ingat macam mana nak buat shoutbox tu . Sowie ) .. Macam biasa Design > Add Gadget > HTML .. Kemudian masuk kan code ni

<style type="text/css">

#gb{
position:fixed;
top:50px;
z-index:+1000;
}
* html #gb{position:relative;}

.gbtab{
height:100px;
width:30px;
float:left;
cursor:pointer;
background:url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi4YeTk_iPEfUN2ZrM-vF4qDfqdZ47JK7sF6JEJmmAGZQ7N3xrSVlr8lKtD2GKMqkPhRDiW_RCHUK11F1Ol6hxznR1T-0b21imbPoesoCRDt9nm_BNrEV4_pJi_Cirpk8LZlntdCEXMIXe/s320/tabs.png') no-repeat;
}
.gbcontent{
float:left;
border:2px solid #666666;
background:#F5F5F5;
padding:10px;
}
</style>

<script type="text/javascript">

function showHideGB(){
var gb = document.getElementById("gb");
var w = gb.offsetWidth;
gb.opened ? moveGB(0, 30-w) : moveGB(20-w, 0);
gb.opened = !gb.opened;
}
function moveGB(x0, xf){
var gb = document.getElementById("gb");
var dx = Math.abs(x0-xf) > 10 ? 5 : 1;
var dir = xf>x0 ? 1 : -1;
var x = x0 + dx * dir;
gb.style.right = x.toString() + "px";
if(x0!=xf){setTimeout("moveGB("+x+", "+xf+")", 10);}
}
</script>
<div id="gb">
<div class="gbtab" onclick="showHideGB()">
</div>
<div class="gbcontent">

KORANG PUNYA CODE SHOUTBOX ..
<div style="text-align: right;">
<a href="javascript:showHideGB()">
[close]
</a> </div>
</div>
</div>
<script type="text/javascript">

var gb = document.getElementById("gb");
gb.style.right = (30-gb.offsetWidth).toString() + "px";
</script>




Yang color BIRU , korang letak lah code shoutbox korang  , yang  color merah , korang leh tukar gambar untuk shoutbox macam kat aku punya blog ni .. MACAM KAT BAWAH NI

Kalau korang kreatif lagi , korang boleh guna hide ni untuk macam macam lagi .. Contoh untuk korang punya 'about me' ke ? Or something yang korang rasa creative , just do it .. It will be my pleasure and for course for my teacher too .. weeeeeeeeeeee .. ^^,

Kalau tak jadi , korang boleh hantar feedback di Terus ke Official MadNip's Blog Page atau di Terus ke Official MadNip's Facebook


Tekan ctrl + c untuk copy , Goodluck

2 comments: