Selamat datang ke BelajarBlogs...
Home » , » Tutorial Membuat Shoutbox Versi Ajax

Tutorial Membuat Shoutbox Versi Ajax



Langkah 1
Login Blogger --> Design --> Add a Widget --> Pilih HTML/Javascript .

Seterusnya Copy kod dibawah dan pastekan pada content..

<!-- Start Ajax Popup Shoutbox by jeritanblog -->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>

<script>
$(document).ready(function() {
//select all the a tag with name equal to modal

$('a[name=modal]').click(function(e) {

//Cancel the link behavior

e.preventDefault();



//Get the A tag

var id = $(this).attr('href');



//Get the screen height and width

var maskHeight = $(document).height();

var maskWidth = $(window).width();



//Set heigth and width to mask to fill up the whole screen

$('#mask').css({'width':maskWidth,'height':maskHeight});



//transition effect

$('#mask').fadeIn(1000);

$('#mask').fadeTo("slow",0.8);



//Get the window height and width

var winH = $(window).height();

var winW = $(window).width();



//Set the popup window to center

$(id).css('top', winH/2-$(id).height()/2);

$(id).css('left', winW/2-$(id).width()/2);



//transition effect

$(id).fadeIn(2000);



});



//if close button is clicked

$('.window .close').click(function (e) {

//Cancel the link behavior

e.preventDefault();



$('#mask').hide();

$('.window').hide();

});



//if mask is clicked

$('#mask').click(function () {

$(this).hide();

$('.window').hide();

});



});
</script>

<style>
img { border: none; }
#mask {

position:absolute;

left:0;

top:0;

z-index:9000;

background-color:#000;

display:none;

}



#boxes .window {

position:fixed;

left:0;

top:0;

width:440px;

height:200px;

display:none;

z-index:9999;

padding:20px;

}
#boxes #jeritanblog {

background:url(http://4.bp.blogspot.com/_5jbp4DbrUeY/TDBnd8hqw_I/AAAAAAAAARc/PTkAREQbwfs/s1600/lightblack.PNG) no-repeat 0 0 transparent;

width:272px;

height:460px;

padding:56px 0 20px 5px;

}
#closesb {

padding:2px 0 0 0;

}
#author {

padding:8px 0 0 168px;

}
</style>


<ul><center> <a href="#jeritanblog" name="modal"><img src="http://i1039.photobucket.com/albums/a472/mijie88/Fail%20Blogspot/shoutboxtab.png" border="0" width="158" height="58" /></a> </center> </ul>

<div id="boxes">

<!-- Start Shoutbox -->

<div id="jeritanblog" class="window">

Masukkan Kod ShoutBox Anda Disini

<div id="author"><a target="blank" href="http://jeritanblog.blogspot.com/2010/11/tutorial-membuat-shoutbox-versi-ajax.html"/><img src="http://img.photobucket.com/albums/v486/mafiatrg/linky.png" /></a>

</div><div id="closesb"><input type="button" value="Close" class="close" />

</div></div><!-- End of Ajax Shoutbox -->
<!-- Mask to cover the whole screen -->

<div id="mask"></div></div>

<!-- End of Ajax Popup Shoutbox by jeritanblog -->

Langkah 2
Masukkan kod shout anda pada perkataan “Masukkan Kod Shoutbox Anda Disini” diatas.
Yang Penting : Pastikan width='261' dan height='380' . Contoh seperti dibawah.

Step 5 : kemudian SAVE. Klik PREVIEW untuk lihat hasilnya.

Untuk tukarframe Template Shoutbox

Anda perlu copy sahaja URl dibawah ini

Tukar Gambar
http://i1039.photobucket.com/albums/a472/mijie88/Fail%20Blogspot/shoutboxtab.png

9 ulasan:

  1. dah try dah..x jadi la.. transparent background x cover whole screen pon

    My recent post: Busy ke sombong?

    BalasPadam
  2. @Mikeon9 nie mesti banyak script pada blog..Kalau banyak memang lambat blog

    BalasPadam
  3. dah boleh , tapi jd besa sgt . n satu lagi .. cane nak buad shout neh ade kat side jew . klik bwu kua . nak sorok laa .. cane ek ?

    BalasPadam
  4. @miea amoi
    pergi laman nie http://jeritanblog.blogspot.com/2010/09/buku-tamu-tersembunyi-version-2.html

    BalasPadam
  5. da buat tp xjadi . lagi satu . camne nak buat sh0utb0x cm kat sini ? semat plak . nak try ? b0ley ?

    BalasPadam
  6. hm , mcm mne nak " Masukkan Kod Shoutbox Anda Disini " ?

    BalasPadam