Tuesday, August 3, 2010

Tutorial ; Buat Floating Shoutbox Di Sidebar

shoutbox da jadi kat tepi ! !
okayy , request ni datang dari Peace Dudes . die tanya camane nak wat ' kotak jerit ' jadi kat tepi . senang je sebenarnye . senang la , sbb aku da tau . hehe . okayy , meh cikgu ajar meh . cikgu wat muka comel ^^

STEP 1 : pegi kat Design > Page Elements > Add A Gadget > HTML / Javascript

STEP 2 : copy kod kat bawah ni & letak kat HTML page yg korang da bukak tadi .
<style type="text/css">
#gb{
position:fixed;
top:100px;  <---- jarak dari atas 
z-index:+1000;
}
* html #gb{position:relative;}

.gbtab{
height:110px;
width:60px;
float:left;
cursor:pointer;
background:url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAcPOp2gxB0D3mck6cwywuYKnP_INbBfUAJe8_wG0-xrk6UqXtba8_0Q9-xTjUUTvifCbBnzu79N7TQUouR0kXFFhnKyhHRdEGqKr38A_cZlm__cYvq-gU08JzMClSF1iunbSoozfzFwuk/s320/tabs.png') no-repeat;
}
.gbcontent{
float:left;
border:2px solid #FFFFFF;
background:#000000;
padding:5px;
}
</style>

<script type="text/javascript">
function showHideGB(){
var gb = document.getElementById("gb");
var w = gb.offsetWidth;
gb.opened ? moveGB(0, 30-w) : moveGB(30-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">

<!-- spacer for skins that want sidebar and main to be the same height-->
      <div class="clear">&#160;</div>

MASUKKAN KOD SHOUTMIX BOX KORANG KAT SINI

<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>
  • utk height & width yg aku merahkan tu , korang bole ubah ikut saiz tab korang .
  • background URL utk tab tu aku da bagi kan . . tapi kalau korang nak tukar ngan tab laen , just replace je URL aku ngan URL korang .
  • then dekat bahagian border & background box content pon boleh ubah ikot suke . nak kod kaler , klik sini okay .
so , basically tu jela . da ciap korang customize shoutbox ! ;D

p . s ; ngantuk giler ! -,- baru lpas bungkus barang nak pos sok .

Kasi komen sikit k?

24 comments:

CahayaMatakuYangMenyaksikan said... [Reply]

mekaseh...

Unknown said... [Reply]

@CahayaMatakuYangMenyaksikan same same ^^

- ly - said... [Reply]

terima kaseh..
skg da tau cane nk ltk kotak jerit kt tepi
heee.... :)

Unknown said... [Reply]

@e.i.l.i.n.u.r same same . hehe .

eila said... [Reply]

tenkiu~!
nice belog... =)

Unknown said... [Reply]

@eilayour welcome :)

eilasuhaila said... [Reply]

cmner nk bg shoutbox tu center?
yg cm awk nya..
hehee~
try gak ubah2..tp jadik pon..

Unknown said... [Reply]

@eilasuhaila ouhh, sory.. kalau nk mcm saye bukan ni tutorial die.. hehe.

klik SINI utk shoutbox cam saya :)

eilasuhaila said... [Reply]

wokeh2..tenkiu. =)

farraain said... [Reply]

tenkiuu..nak cuba lahh..ehee..:)

Unknown said... [Reply]

@farraain welcome, tryla! :D

elianesuriane said... [Reply]

thnx utk tuorial ini..

Unknown said... [Reply]

@elianesuriane same same :)

Nizam Ijam said... [Reply]

Nizam ijam: macam nak tkar shout box tu kpd pic y kter nak...mcm awk pyer gmbr teddy tue..

Nizam Ijam said... [Reply]

nak tkar pic shoutboz tu kpd pic kter..mcmm mana erk...klu kat shoutbox awk tuh..awk tulis jerit..

Unknown said... [Reply]

@Nizam Ijam dekat kod yg saye bagi tu de url yg saye highlight kaler merah, tu url utk 'jerit/teddy'. kalau nak tukar ke pic sndri, tukar url tu kpd url gmbar awk. upload gmbar awk kat photobucket dulu, copy direct link & replace url yg saye bagi tu :)

Yee Farida said... [Reply]

woah ~ thank you sooo much !

Unknown said... [Reply]

@Yee Farida your welcome ;)

Anonymous said... [Reply]

..THANKS! ;))
it helps a lot!

aslann said... [Reply]

sangat bergune..den nak toraii! thanks!! >.<

Izzah Liyana said... [Reply]

sys , knp xda button close ?

Nurul Husnina Izzati said... [Reply]

thank you !

melor md hodari said... [Reply]

lama dh cari tutorial cenggini..blog kite xlawo..mekacih

Anonymous said... [Reply]

menjadi...hehe..thanks yer

 
back to top Blacy Smiley - Haha Bucktooth