Visitor

Game

WELCOME

Selamat datang di blog yang sederhana ini :D semoga anda betah menjelajah di blog ini.. silahkan baca - baca di artikel terbaru saya.. terima kasih telah berkunjung ^_^
Selengkapnya tentang saya

Tentang Saya.

Ghonhey Alvieroputra

Ghonhey Alvieroputra
Perkenalkan, saya Ghonhey seorang pendatang baru dunia blogger.. saya masih dalam tahap pembelajaran, jadi mohon maaf jika ada banyak kesalahan di blog ini.. jangan dihina ya bro :D

FIND ME ON..

RSS twitter facebook HOME
Info

Saturday, 27 July 2013

Membuat Background Blog Slide Show

 
Background Slide Show adalah gambar latar belakang yang bisa berganti-ganti secara otomatis setiap waktu yang telah ditentukan. Background ini disematkan di bagian body dengan posisi 100%.

Background Slide Show ini pertama-tama harus di load dengan JQuery yang biasanya dipasang di atas </head>


<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js' type='text/javascript'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js' type='text/javascript'></script>


Setelah itu dibagian CSS body, minimal harus ada seperti ini:


body {
   background: black url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvRRE3k8XD6mH47WjYIrpgcHZ87SQBI4gY3iOstQy-4Sjx8BF0EIz8VkS36o3NOS0dsb6BYxR_dmi1qycxRemQDkV1NCkj0WZ87dp1Ucn11e8eJnMTaO0oxnuUMKumcyIUbvO30pzc0aw/s320/body-santa.jpg) repeat-x fixed top center;
   -moz-background-size:100%;
   -webkit-background-size:100%;
   -o-background-size:100%;
   background-size:100%;
}


Jika sudah terpasang juga, kita harus menambah JavaScript Backround Slide Show di bawah ini:

<script type='text/javascript'>
var ssBG={
  gbr:[
    "http://2.bp.blogspot.com/-jXDDlst7GMc/T1SDEQ72L6I/AAAAAAAAMKc/7C4dD51XSNY/s1600/Windows-8-HD-Wallpapers+%281%29.png",    
    "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHmzmVrtjvvDlNantp10EF2Lfq5BWJpjTx3346EWPfyabAakDOYQStAQMnU9M8PcsEnuVoE_NrSEN-jdatctqb-gFlxwX15Y0NCyL6RguPD6MdBvriO-NPinoWRzVLn2wS-IJWMDI/s1600/Windows+8+xTreme+Edition.jpg",
    "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNiFd8nYTKWiJnilOwrIIuWhGYpFzupN8ZDy61gvlGVE9MAtWXCnf7gg4bzoie6muEwYVcbU4zvEnSGDtTpewSnuOIr9mAK9agK-A-MlUJlM_zCk6waT1ewUCH680t43QedyafKcgRs3U/s1600/Windows_8_wallpapers_3.jpg",
    "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFoN-rDLwFEsN0GO0f18MtINh7DQX04utfEBLBFMeReB15HHvr-6LLieLbWNc8d_ywjYCndI4x3081uuDAlKc7fAUNQovSfMM5iI0kzYsDi7_Hzk04B7FhszZ31pmOJgobVyY8yI2W3SU/s1600/windows8professional.jpg",
    "http://www.smartearningmethods.com/wp-content/uploads/2012/03/Scenic-Windows-8-9.jpg",
    "http://img225.imageshack.us/img225/4564/39003694.jpg", 
    "http://www.deviantart.com/download/243901871/windows_8_3d_by_faisalharoon-d417nvz.jpg", 
    "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2SO91uQEeKMiSADszFmNcI1qKYZ3cReZFvGMt3_70LQMpY3MJvGAkzNF8oFKlDDRyolCwmbeNnBnpdtE0vWRXMSGPRqsZHz0XmfkRODhBXVPQHGbI5a6mUYpvlWiA4wwSYYoj7aQXu2w/s1600/China_Country_4+%28wallpapersbay.blogspot.com%29.jpg",
    "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaQ8nvInkG8PmhX6Wc7aBgBfxGjRyvMZvGTXRPGaJmS_h29OPuKlS4m2dG8sEM8kuGqK9DqsF6GANF0XBDzIFXnKEqK3ibtltdjHz1J4PGadO8OVQQm2wNyliY5lP-GdybwQC90s-gBGo/s1600/Rainbow_Wallpapers_(1)+%28wallpapersbay.blogspot.com%29.jpg",
    "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS3GRvnrPR-3hIect5j0es3Xf2GBdvHJk_5wmrjg7v7xTtRAmQ3vrShyfKZ75RraahHfodOgvj3R6kGWil4fl0uQEdRS4SYcFzQmxB9ERHaEARmMqU8XIGDx_qMoVfHuMcQUqY_g07biA/s1600/Creative-Digital-Animal-Wallpapers-24+%28wallpapersbay.blogspot.com%29.jpg", 
    "1.bp.blogspot.com/_KjKudOQDFIw/TIBQjNvqJHI/AAAAAAAADRo/g_FBWqwMKAw/s1600/Thunder_Storm_Wallpapers_%2837%29+%28wallpapersbay.blogspot.com%29.jpg" 
  ],
  now:0,
  SlideMyBG:function(list,style,speed,bgPos,bgSize,bgRep){
    if(!ssBG.SlideMyBG.hasRun){ssBG.SlideMyBG.hasRun=true;
    if(list==null||list==''){list=ssBG.gbr}else{if(typeof list!='object'){list=ssBG.gbr}}
    if(style==null||style==''){style='random'}
    if(speed==null||speed==''){speed=5000}
    if(bgPos==null||bgPos==''){bgPos='top center'}
    if(bgSize==null||bgSize==''){bgSize='100%'}
    if(bgRep==null||bgRep==''){bgRep='repeat'}
    ssBG.gaya=style;ssBG.jeda=speed;ssBG.gbr=list;ssBG.pos=bgPos;ssBG.size=bgSize;ssBG.rep=bgRep;
    ssBG.opt={'background-attachment':'fixed','background-repeat':ssBG.rep,'-moz-background-size':ssBG.size,'background-size':ssBG.size};
    }
    if(ssBG.gaya=='random'){ssBG.gbr=ssBG.gbr.sort(function(){return 0.5-Math.random()})}
    var img=new Image();var brp=ssBG.gbr.length;if(ssBG.now>=brp){ssBG.now=0}
    var gbrSkrng=ssBG.gbr[ssBG.now];ssBG.now++;
    if($('#bg-fader').length==0){$('body').prepend('<div id="bg-fader" style="opacity:0.0;top:0;left:0;width:100%;height:100%;background-color:'+$('body').css('background-color')+'"></div>');$('#bg-fader').css(ssBG.opt);$('body').css(ssBG.opt)}
    $(img).load(function(){
      $('#bg-fader').css({'background-image':'url('+gbrSkrng+')','background-position':ssBG.pos}).animate({opacity:1.0},'slow','linear',function(){
        $('body').css({'background-image':'url('+gbrSkrng+')','background-position':ssBG.pos});
        $(this).animate({opacity:0.0},'slow','linear');
        setTimeout("ssBG.SlideMyBG()",ssBG.jeda);
      });
    }).attr('src',gbrSkrng).error(function(huh){ssBG.SlideMyBG()});
  }
};
</script>

<script type='text/javascript'>$(window).load(function(){ssBG.SlideMyBG()})</script>

1 comments

Anonymous

kreen nih postingannya,, tp kyaknya akan memberatkan blog yah..

Post a Comment