Wednesday, October 24, 2012

Cara Membuar Welcome Image Pada Blog



Preview:
Paparan welcome image ini akan muncul pada permulaan, sebelum masuk ke blog korang. Selepas klik pada welcome image ini, blog akan muncul dengan efek "fade in" yang menarik. Ibarat macam buka pintu sebelum masuk rumah ^_^ Ikuti tutorial di bawah.

*Sebelum tu, korang dinasihatkan supaya backup template terlebih dahulu, sebab once korang dah apply benda ni dekat blog, kod dia dah tak boleh delete. So ambik langkah berjaga-jaga, backup template dulu ye.


Caranya:

1) Sign in akaun blogger

2) Dashboard > Design > Edit HTML > Tick kotak "Expand Widget Templates"

3) Dengan menggunakan ctrl + F (tekan serentak pada keyboard), cari kod
]]></b:skin>


4) Kemudian, copy dan paste kod di bawah SEBELUM / DI ATAS kod]]></b:skin>
</style></head>
<script language="javascript" type="text/javascript">
/* toggle() checks to see if the images has already been faded
or not and sends the appropriate variables to opacity(); */
function toggle(el,milli) {
// Get the opacity style parameter from the image
var currOpacity = document.getElementById(el).style.opacity;
if(currOpacity != 0) { // if not faded
fade(el, milli, 100, 0);
} else { // else the images is already faded
fade(el, milli, 0, 100);
}
}
/* changeOpacity() uses three different opacity settings to
achieve a cross-browser opacity changing function. This
function can also be used to directly change the opacity
of an element. */
function changeOpacity(el,opacity) {
var image = document.getElementById(el);
// For Mozilla
image.style.MozOpacity = (opacity / 100);
// For IE
image.style.filter = "alpha(opacity=" + opacity + ")";
// For others
image.style.opacity = (opacity / 100);
}
/* fade() will fade the image in or out based on the starting
and ending opacity settings. The speed of the fade is
determined by the variable milli (total time of the fade
in milliseconds)*/
function fade(el,milli,start,end) {
var fadeTime = Math.round(milli/100);
var i = 0; // Fade Timer
// Fade in
if(start < end) {
for(j = start; j <= end; j++) {
// define the expression to be called in setTimeout()
var expr = "changeOpacity('" + el + "'," + j + ")";
var timeout = i * fadeTime;
// setTimeout will call 'expr' after 'timeout' milliseconds
setTimeout(expr,timeout);
i++;
}
}
// Fade out
else if(start > end) {
for(j = start; j >= end; j--) {
var expr = "changeOpacity('" + el + "'," + j + ")";
var timeout = i * fadeTime;
setTimeout(expr,timeout);
i++;
}
}
}
</script>
<div class="input" onClick="javascript:toggle('wise', 3000); this.style.display='none';
document.getElementById('june').style.display=''">
<center><img src="URL IMAGE WELCOME"
style="opacity:0.4;filter:alpha(opacity=40)"
onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100"
onmouseout="this.style.opacity=0.7;this.filters.alpha.opacity=40"/></center>
</div>
<div id="wise" style="filter : alpha(opacity=0); -moz-opacity : 0; opacity : 0;">
<div id="june" style="display : none;">
<body>

Nota:
Pada  URL IMAGE WELCOME, korang masukkan url image welcome yang korang suka. Image welcome korang boleh pilih kat bawah, copy url yang disediakan.

http://img811.imageshack.us/img811/2034/74209346.png




http://img830.imageshack.us/img830/7516/64141948.png


http://img190.imageshack.us/img190/2280/87105761.png




http://img42.imageshack.us/img42/2760/13929553.gif





http://img831.imageshack.us/img831/7031/46029943.gif




http://img137.imageshack.us/img137/6722/78563544.png




http://img821.imageshack.us/img821/1397/61645383.png


http://img827.imageshack.us/img827/2415/47060660.gif


5) Selepas masukkan url image pada kod, korang klik save template. Kemudian akan keluar "keep widget or delete widget", pilih delete widget ye.

6) Lastly klik preview, kalau menjadi, terus klik save template.

Selamat mencuba! :)

mm:



0 comments:

Post a Comment

Blog Dian Alm II © 2008. Template by: Infonetmu