Membuat Background Bergerak di Blog

Cara Membuat Background Bergerak di Blog sangat mudah yg hanya menggunakan Script.Script ini membuat gambar background blog bergerak secara vertikal dari arah bawah ke arah atas. Buat sobat blogger yang ingin mencobanya silakan disimak trik membuat scrolling background berikut ini :


  • Login » blogger.
  • Rancangan » Edit HTML 
  • Copy-Paste kode di bawah ini tepat di atas Kode </Head>
<script type='text/javascript'>
//<![CDATA[
$(function(){
// ***
// Scrolling background
// ***
// height of background image in pixels
var backgroundheight = 4000;

// get the current minute/hour of the day
var now = new Date();
var hour = now.getHours();
var minute = now.getMinutes();

// work out how far through the day we are as a percentage - e.g. 6pm = 75%
var hourpercent = hour / 24 * 100;
var minutepercent = minute / 30 / 24 * 100;
var percentofday = Math.round(hourpercent + minutepercent);

// calculate which pixel row to start graphic from based on how far through the day we are
var offset = backgroundheight / 100 * percentofday;

// graphic starts at approx 6am, so adjust offset by 1/4
var offset = offset - (backgroundheight / 1);

function scrollbackground() {
// decrease the offset by 1, or if its less than 1 increase it by the background height minus 1
offset = (offset < 1) ? offset + (backgroundheight - 1) : offset - 1;
// apply the background position
$('body').css("background-position", "50% " + offset + "px");
// call self to continue animation
setTimeout(function() {
scrollbackground();
}, 70
);
}
// Start the animation
scrollbackground();
});

//]]>
</script>
  • Copy-Paste Kode CSS di bawah ini tepat di atas Kode </Head> untuk memasang gambar background. Anda dapat mengganti gambar background sesuai dengan yang anda inginkan dengan merubah alamat hosting gambar 
<style>
body {
background: black url(http://lh6.googleusercontent.com/-5pLorlV3H-I/T4a0Sdg2iQI/AAAAAAAABi4/2EKSDnkxz9s/s800/bg.gif) repeat center; background-attachment: fixed;
}
</style>
kode yang berwarna merah dapat anda ganti dengan  URL Link gambar berikut :
Pilihan Gambar Dan Linknya :


https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBmTDducKNvJC3euZK7HkGimBJOWPGWiAhvHS4tJpI3KL5lXoCRXedagUB5wshYwlEhsqSwmtKCgtOAIpj9xiaykhFSbTAdrtEnkb032GSCdSKFXSpPHSgUXhfs1AAWzsteL_eOtl6xN6L/s800/bg.gif



https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMaNm8govHIR9vOMqAZ_uBvowlo9Dva4RRzTTtRbZz22mhIWor-Pq-LU0RRdKLxlj9siOmIq5xmb6s4nwm3b-0pBibO_U4g2u-IQPPxL9N99PFp7TTvAyEhSRdBTTItAo9rXbS4BUq2n0T/s800/devil_angel_lolita_bg.png 



https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0CQbUK4zEJ6NSyC_Q9QiuaaMOqdifrVz5F4xsJTJw33IlUYgadzDSdWDNqF_QZyn9erRJHROlApIjqbRVhDC0xmyFernSbU4OjicC9f8loiw2Up_7omEFd_leRgog3_UEAnllxh2GmiZJ/s800/animated%2520blue%2520stars.gif



https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO9eoHv7xPWmuPXn8kryCxf2cld1TOeGcIGEYtpA29BJaZzZBjFwTX3OkdJlAOVoyn8y3E4JkZopQtt1QeWoHA9Di9xSgWboIBNQhR60XGEgwLGyN6NnJMH4ZqManDJogRVnGHXjZBuSwG/s800/ThighHeels.png 


https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy0pYATykISWvmvQwOYDIFKkPTkgeiE9QDTHh2XjapUM1t3f1ac2Or412_W1F9_l5fRe2Zi0ckzdD4HVulBte7XCG-6_QWahQuQUp4OwSvqQurJYS3QH7lfTjzZlVK3eIq-ngiHDhqHznO/s800/animated%2520stars.gif 



https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigX773QTGvHu3WU7TqxP-nZcCSGfSEpdZO8N2yFkqbfKY_w28Pl4dSl_buH2eZQvVLOHoa9Qtb0LDtIyz2I_Tkfii_q3i6NQVqfRKfM4yfCB9rNdVQxxEw0WsdXxlexBeLLW95OCibd6mu/s800/bg_star.png 



https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLVDo8-rtWj6mf0MUubUqDroXAGoQtKa8nqaKAI7dNGEhweUdABrIl7uAlxUWJOI_K8D3LYSneb5jzcef8M-tu8wdkRears6wOxWVXhu2sLJicv8vKbJ00cVwfGRmNPRzq0W6ijJrrsoAO/s800/bg-clouds.jpg 



https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBVn1JalwsHym_h94iy4SSvgl-MdAg_F5AaiTXM4ZmeY07_gEprq2-5XoBi7kDfV4DDkedSQVpvvvv1ik2PGcEg5va4WrqHxra4KIutya1hdVHqo2DAlgPhbjsYOxUZ6HwcA2tyAQ_qmaZ/s800/skull-fire-monozcore.png 



https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNfQD-d3cOp_3zPnpFqnfKGUrcCYUg8HWQ9bJtASnZBY8nYgRU1PrgtBEk5YTO0yA09yUMULyhW2Xinxjfo44uzhUyguH3iNNB5EewoFgUNSEfnq5JutTYfYLh4ZQM-Zu8_ktHhBjDrVu3/s800/dance_flow.png

Tidak ada komentar:

Posting Komentar