Wednesday, 27 July 2011

Shoutbox show / Hide Dari Atas

pegi Dashboard > Design > Page Elements > Add Gadget > HtmL Javascript


copy and paste code kat bawah ni..

sebelum save kena tukar SHOUTBOX CODE ngan code shoutbox korang ok.. :D

<style type="text/css">
#gb{
position:fixed;
right:350px;
z-index:+1000;
padding: 5px 15px;
}
* html #gb{position:relative;}
.gbtab{
height:100px;
width:300px;
float:center;
cursor:pointer;
background:url(blog-bg.png);
}
.gbcontent{
float:center;
background:#fff;
border-right: 5px solid orange;
border-bottom: 5px solid magenta;
border-top: 5px solid cyan;
border-left: 5px solid pink;
-moz-box-shadow: 0 20px 20px #000;
-moz-border-radius-topleft:1px;
-moz-border-radius-topright:1px;
-moz-border-radius-bottomleft:1px;
-moz-border-radius-bottomright:1px;
padding:10px;
}
</style>
<script type="text/javascript">
function showHideGB(){
var gb = document.getElementById("gb");
var w = gb.offsetWidth;
gb.opened ? moveGB(0, 1500-w) : moveGB(20-w, 0);
gb.opened = !gb.opened;
}
function moveGB(x0, xf){
var gb = document.getElementById("gb");
var dx = Math.abs(x0-xf) > 25 ? 35 : 1;
var dir = xf>x0 ? 1 : -1;
var x = x0 + dx * dir;
gb.style.top = x.toString() + "px";
if(x0!=xf){setTimeout("moveGB("+x+", "+xf+")", 10);}
}
</script>
<div id="gb">
<div class="gbtab" onclick="showHideGB()">
</div>
<div class="gbcontent">


<!--  SHOUTBOX CODES -->


<center><a href="javascript:void(0);" onclick="showHideGB()"><input class="close" type="button" value="Close" /></a>

</center></div>
</div>
<script type="text/javascript">
var gb = document.getElementById("gb");
gb.style.top = (-400-gb.offsetWidth).toString() + "px";
</script>

<a class="west" href="javascript:void(0);" onclick="showHideGB()" title="chit chat"><img alt="shout !" border="0" heigth="125" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgULRoWfPfMr4mRcv9h2J52tQHiW5GbWaX8JYPGyccFGGCI_pY6iBgTu_ntqtsDFnN-W1vl5SSxklNrhJrDHhxwny7ifmsaeRilVodGicoQIcFLHBDOj4Vd_8Cb-oVI4gmN5UySNUcqS0s/s1600/Guestbook.png" /></a>


 image yang akan keluar untuk di-click nanti , camni ah..



tapi,
kalo korang tak berapa nak minat..code purple tu boleh tukar untuk tukar image kat atas ni ye~ :D

No comments: