Posts Subscribe to This BlogComments

Follow Us

Sunday, 3 July 2011

Chat Box Dari Atas

Kali ini Boku akan membagi tips dan trik "Cara Membuat Chat Box Muncul Dari Atas".

Ini SSnya...:

Langsung aja...

1. Login blogger
2. Klik Rancangan, Tambah Gadget, Html/java script
3. Dan Simpan kode berikut :

Kode...:
<style type="text/css">
#at{
position:fixed;
right:450px;
z-index:+1000;
}
* html #at{position:relative;}
.attab{
height:100px;
width:30px;
float:left;
cursor:pointer;
background:url();
}
.atcontent{
float:left;
border:2px solid #999;
background: #000;
-moz-border-radius-topleft:15px;
-moz-border-radius-topright:15px;
-moz-border-radius-bottomleft:15px;
-moz-border-radius-bottomright:15px;
padding:10px;
-moz-box-shadow: 0px 2px 5px 0px #f8f9b9;
}
</style>
<script type="text/javascript">
function showHideAT(){
var at = document.getElementById("at");
var w = at.offsetWidth;
at.opened ? moveAT(0, -200-w) : moveAT(20-w, 0);
at.opened = !at.opened;
}
function moveAT(x0, xf){
var at = document.getElementById("at");
var dx = Math.abs(x0-xf) > 25 ? 35 : 1;
var dir = xf>x0 ? 1 : -1;
var x = x0 + dx * dir;
at.style.top = x.toString() + "px";
if(x0!=xf){setTimeout("moveAT("+x+", "+xf+")", 10);}
}
</script>
<div id="at">
<div class="attab" onclick="showHideAT()">
</div>
<div class="atcontent">
<div align="center">
<div style="background: #000;">

</div>
</div>

<div align="right">
<a href="javascript:void(0);" onclick="showHideAT()"><img alt="close" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4AhTaI_PAWDtnRO3JjywivZaZj8eF2reBWQBFs6e2hIG5HfNMSiynCuQ16W9ZA-5EwrJ6ic9aftY70HvAYr9m72BiwBZxseG4QIT8xdvZVDt18moZSQUQ2CZYAUxgZZgF-Nvr9Rs79Yu1/s1600/close.png" title="Click here to Close Cbox" /></a></div>

</div>
</div>

<script type="text/javascript">
var at = document.getElementById("at");
at.style.top = (-200-at.offsetWidth).toString() + "px";
</script>

<center><a href="javascript:void(0);" onclick="showHideAT()"><img alt="cbox" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEietriCUFPcacB9PaunSd6tDKGadG_bg2d5mfAVNctqk6CwR4vkdYQAB7_2P_Oa98s50FmGEyfamhEr2BYXC-8fW6FiIA_jk6xy4TthpQs2g_y68SzbqJh5rzKAUBYOgL6s-g7lImstEDW7/s1600/Chatbox.png" title="Click here to open Guest Book" /></a></center>

Catatan:
Jika ingin menampilkan posisi Tombol di samping seperti Blog saya ini, Tinggal ganti Kode di bawah ini
<center><a href="javascript:void(0);"onclick="showHideAT()"/><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEietriCUFPcacB9PaunSd6tDKGadG_bg2d5mfAVNctqk6CwR4vkdYQAB7_2P_Oa98s50FmGEyfamhEr2BYXC-8fW6FiIA_jk6xy4TthpQs2g_y68SzbqJh5rzKAUBYOgL6s-g7lImstEDW7/s1600/Chatbox.png" alt="cbox" title="Click here to open Guest Book" /></a></center>

Dengan Kode di bawah ini
<div style='display:scroll; position:fixed; top:20px; right:0px;'>
<a href="javascript:void(0);"onclick="showHideAT()"/><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEietriCUFPcacB9PaunSd6tDKGadG_bg2d5mfAVNctqk6CwR4vkdYQAB7_2P_Oa98s50FmGEyfamhEr2BYXC-8fW6FiIA_jk6xy4TthpQs2g_y68SzbqJh5rzKAUBYOgL6s-g7lImstEDW7/s1600/Chatbox.png" /></a>
</div>

Related Post



0 comments:

Post a Comment

 

Followers

Categories