WeLCoMe To My BloG^.^

anyang aseo!!

Thursday, 15 September 2011

tutorial>camne nak buat shoutbox melayang

ermmm...ade org letak shout box kat side bar,ade 2 shoutbox dya maen sembunyi2....hah!yg ni yg melayang muncul tengah2 blog..hohoho...nak tau camne nak buat!hah....ikut step2 ni...

1.login masuk>dashboard>design>add gadget>html/javascript
2.copy code nie...

<!-- Start flying Shoutbox  by ybl -->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js%22%3E%3C/script>
<script>
$(document).ready(function() {
//select all the a tag with name equal to ybl
$('a[name=ybl]').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 tbbHeight = $(document).height();
var tbbWidth = $(window).width();
//Set heigth and width to tbb to fill up the whole screen
$('#tbb').css({'width':tbbWidth,'height':tbbHeight});
//transition effect
$('#tbb').fadeIn(1000);
$('#tbb').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();
$('#tbb').hide();
$('.window').hide();
});

//if tbb is clicked
$('#tbb').click(function () {
$(this).hide();
$('.window').hide();
});

});
</script>
<style>a {color:#ffffff; text-decoration:none}
img { border: none; }
#tbb {
position:absolute;
left:0;
top:0;
z-index:9000;
background-color:#000;
display:none;
}
#ddt .window {
position:fixed;
left:0;
top:0;
width:440px;
height:200px;
display:none;
z-index:9999;
padding:20px;
}
#ddt #yblshoutbox {
background:url(https://lh5.googleusercontent.com/-nDP_P-QqX54/TWoQRu88UxI/AAAAAAAABaU/oJ_e6l8Kdg0/s1600/shout.gif) no-repeat 0 0 transparent;
width:272px;
height:460px;
padding:60px 0 20px 15px;
}
#ttp {
padding:2px 0 0 0;
}
</style>
<ul><center> <a href="#yblshoutbox" name="ybl"><img src="https://lh3.googleusercontent.com/-orZIIwB83bI/TWoQjbTHR6I/AAAAAAAABaY/6epCnQ_6Ar8/s512/button.gif" border="0" width="128" height="58" /></a> </center> </ul>
<div id="ddt">
<!-- Start Shoutbox -->
<div id="yblshoutbox" class="window">

paste code shoutbox anda

<div id="ttp"><input type="button" value="Close" class="close" style="background: #0066FF; color: #ffffff;"/><a href="http://teknikbuatblog.blogspot.com/2010/12/cara-pasang-shoutbox-melayang.html%22%3E%3Cfont size="1">get this</font>
</a></div></div><!-- End Shoutbox -->
<div id="tbb"></div></div>
<!-- End of flying Shoutbox  by ybl -->

3.paste n save

and there u ar....shoutbox melayang sedia digunakan.
eh3...cop!ade lagi...nampak x writing yg kaler merah 2...??hah!yg 2 fhm2 je la ye.pastekn code shoutbox korg sendiri...n kalu nk tukar width n height dya pown bole...buat sendiri je...klu sy guna width 100% n height dya 370px.....so try it urself...

No comments:

Post a Comment