BUMP STICK ;)

Saturday, 16 July 2011

tutorial Ajax float shoutbox

25 December 2010

Tutorial : Ajax Float Shoutbox




Assalamualaikum !

Oke Dokie,
Dah 2 Tutorial tuk hari ni,
Direquest oleh Cik Fajie !

Haha, merosakkan pantun betullah saaya ni ! Hurm, AMARAN ! Tutorial ni agak berbelit-belit. So, kalau tak faham apa Ainaa merepek sat lagi, tanya la ye ? Hurm Jom Startt ! Sebelum tuh, segment Contoh lah dulu ! :D

Segment Contoh !

Ikon Shoutbox :



Body/Background Shoutbox :



1) Benda alah yang ditulis dibawah WAJIBUN korang kena edit. Design kedua-dua benda yang dilistkan dibawah mengikut kreativiti kepale otak anda sendiri. Mampuih kalau korang asyik-asyik jadi copypig. Kalau tak tau apa benda yang ditulis dibawah, boleh tengok segment Contoh.

Icon Shoutbox

Body/Bakcground Shoutbox

2. Edit punya edit, dah siap benda tadi tuh, upload kat Photobucket ! Tak ada akaun Photobucket ? Sign Up kat www.photobucket.com !

3) Dah siap Upload, abaikan Tab tu sementara. Sekarang, buka New Tab, Pergi ke www.blogger.com dan Sign In !

4) Pergi ke Design >> Add New Gadget >> HTML Java Script

5) Copy & Paste Code dibawah :

<div style='display:scroll; position:fixed; top:70px; right:-0px;'>

<!-- Start Ajax Popup Shoutbox by -->

<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});







//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:center;

left:0;

top:0;

z-index:9000;

background-color:#000;

display:none;

}



#boxes .window {

position:fixed;

left:0;

top:0;

width:271px;

height:480px;

display:none;

z-index:9999;

padding:20px;

}

#boxes #wanhazelshoutbox {

background:url(BODY/BACKGROUND SHOUTBOX) no-repeat 0 0 transparent;

width:271px;

height:480px;

padding:56px 0 20px 5px;

}

#closesb {

padding:2px 0 0 0;

}

#author {

padding:8px 0 0 168px;

}

</style>

<ul><center> <a href="#wanhazelshoutbox" name="modal"><img src="ICON SHOUTBOX" border="0" /></a> </center> </ul>

<div id="boxes">

<!-- Start Shoutbox -->

<div id="wanhazelshoutbox" class="window">
<!-- Begin ShoutMix - http://www.shoutmix.com/ --><center>




CODE SHOUTMIX




</center>
<!-- End ShoutMix -->

<div id="author">

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

</div></div><!-- End of Ajax Shoutbox -->

<!-- Mask to cover the whole screen -->

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

<!-- End of Ajax Popup Shoutbox--></div>

6) Gantikan....

*URL  Icon kepada URL korang.

*URL Body/Background dengan URL Korang.

*Code Shoutbox dengan Code Shoutbox korang.

Kalau korang semua dah siap, ia akan jadi macam kat bawah ni. Ini Contoh Ainaa punya Code.

<!-- Start Ajax Popup Shoutbox by -->

<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});







//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:center;

left:0;

top:0;

z-index:9000;

background-color:#000;

display:none;

}



#boxes .window {

position:fixed;

left:0;

top:0;

width:271px;

height:480px;

display:none;

z-index:9999;

padding:20px;

}

#boxes #wanhazelshoutbox {

background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-TO91CkiJIQKpEsknIcIs9Naye8n9VWXFc3Ro1zNxfuMWQCjYBCDBCaSED6diKUcgPC6i4UBjNAR_lFULU2-cq7J1dF2_VdIzI9ePLLC1GK96hEqzlce2YCYyOsYoEpiy5zeXNAPx9zQ/s1600/red.png) no-repeat 0 0 transparent;

width:271px;

height:480px;

padding:56px 0 20px 5px;

}

#closesb {

padding:2px 0 0 0;

}

#author {

padding:8px 0 0 168px;

}

</style>

<ul><center> <a href="#wanhazelshoutbox" name="modal"><img src="http://i1180.photobucket.com/albums/x416/whatevagurl/iconkerropi.png" border="0" /></a> </center> </ul>

<div id="boxes">

<!-- Start Shoutbox -->

<div id="wanhazelshoutbox" class="window">
<!-- Begin ShoutMix - http://www.shoutmix.com/ --><center>




<!-- Begin ShoutMix - http://www.shoutmix.com -->
<iframe title="AinaaMania90" src="http://www1.shoutmix.com/?AinaaMania90" width="225" height="370" frameborder="0" scrolling="auto">
<a href="http://www1.shoutmix.com/?AinaaMania90">View shoutbox</a>
</iframe>
<!-- End ShoutMix -->



</center>
<!-- End ShoutMix -->

<div id="author">

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

</div></div><!-- End of Ajax Shoutbox -->

<!-- Mask to cover the whole screen -->

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

<!-- End of Ajax Popup Shoutbox--></div>

8) Sudah siap ? Save ! :D

 Ini dia Shoutbox yang Ainaa handmade untuk korang. Please Comment kalau dah ambik Body/Background Shoutbox ini :D Body/Background akan ditambah mengikut semasa ke semasa.Okla, Toodles !

BLUEISH :
http://i1180.photobucket.com/albums/x416/whatevagurl/anigifbiru.gif
GREENY :
http://i1180.photobucket.com/albums/x416/whatevagurl/anigifhijau.gif
PURPLELICIOUS :
 http://i1180.photobucket.com/albums/x416/whatevagurl/anigifpepel.gif 
PINK
 http://i1180.photobucket.com/albums/x416/whatevagurl/ainaamaniaanimated.gif

Credits : Abang Wanhazel


Sekian,

No comments:

Post a Comment

Penekan KeyBoarding

My photo
Hulu Langat, Selangor, Islam, New Zealand
nama saye Mimmy Nur Affyda.. Panggil mimmy or mimie? ala.. same ajea ;) syg kt saya x? iloveyou soo much moredear :)hihi~ abg ayie? itu abg saya.. azahari... tgok kt "abg ayie" coml kn? dy abg ksayangn saya.. nk jd abg saya? bolehsahajja... loveyoumoreeee.. im? 13 years old sajja...SMK Dusun Tua 2.. Hulu Langat sajja.. No idea's to say whattut? ok.. tyetye~ tydo duluu ;)Tayken by BIE SYAKIR NAJEMIY... AT 23 JULLY... BYE! ^BIE NAJEMIY LOCH BBY MIMMY^

Pukul Berapa Datuk Harimau?

http://applepine.chu.jp/line/sen/tarugi200.gifhttp://applepine.chu.jp/line/sen/tarugi200.gif
http://applepine.chu.jp/icon/sen/apple1.gifHarap terhibur dengan semua post aii :)http://applepine.chu.jp/icon/sen/apple1.gif
http://applepine.chu.jp/line/sen/tarugi200.gifhttp://applepine.chu.jp/line/sen/tarugi200.gif