Gedung Sekolah

SMK INFORMATIKA PESAT (Pembangunan Satu)
Dan
Lapangan Olahraga

Gedung Yayasan

PESAT (Pembangunan Satu)
Beserta
Ruang Kepala Sekolah, Guru, Rapat Dan Lain - Lain

Kegiatan Belajar Mengajar

SMK INFORMATIKA PESAT (Pembangunan Satu)
Kelas XII
Jurusan REKAYASA PERANGKAT LUNAK

Kegiatan SHALAT

Dhuha, Dilakukan pada Pagi hari dan Asmaul husna, Berdzikir, dan Berdoa

Pecinta Lingkungan Hidup

Menyirami Tanaman Di Pagi Hari, Sebelum KBM (Kegiatan Belajar Mengajar) Dimulai ...

Upacara Bendera

Dilakukan Pagi, Di Lapangan SEKOLAH

Tablig Akbar

Bersama Ust. Aripin Ilham di kampus SMK INFORMATIKA PESAT

Kegiatan BTQ

BTQ (Baca Tulis Quran), agar semua lulusan SMK INFORMATIKA PESAT bisa membaca Al Quran

Kamis, 03 Mei 2012

Pasang Slider di Blog




Earlier this week i brought you a very cool jQuery Featured Image Slider that can slide images and videos.In that post i explained how  i hadn't covered featured sliders or slideshows too much but was gonna make up for it.So here we have another featured slider slash slideshow slash image carousel.The slideshow in this post has a simple style but that gives us some extra options, the main one is you can easily make it any size to suit your blog or the images you want to use.
Add The Simple Stylish Featured Slideshow To Blogger




In the demo i have made it quiet small so it will fit above the posts section.But you can have it fit neatly above your posts or you can have it span across your full blog in the cross column zone.





View Demo Button


Pretty nifty, credit goes to Sohtanaka and the download for Wordpress or other platforms can be found there.Lets see how you can add it to Blogger.


Step 1. In your Blogger dashboard click Design > Edit Html


Design Edit Html Blogger


Step 2. Find the following piece of code in your blogs Html : (Click Ctrl and F for a search bar to help find the code - More Info)


]]></b:skin>


Step 3. Copy and Paste the following code Directly Above / Before ]]></b:skin>


/*--Main Container--*/
.main_view {
float: left;
position: relative;
}
/*--Window/Masking Styles--*/
.window {
height:250px; width: 500px;
overflow: hidden; /*--Hides anything outside of the set width/height--*/
position: relative;
}
.image_reel {
position: absolute;
top: 0; left: 0;
}
.image_reel img {float: left;}


/*--Paging Styles--*/
.paging {
position: absolute;
bottom: 40px; right: -7px;
width: 178px; height:47px;
z-index: 100; /*--Assures the paging stays on the top layer--*/
text-align: center;
line-height: 40px;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGT0LSCZWMtT7gFKz1Z31qn2RGBYb9XN61w4bUS5e0-Sx-tWf4jxNNhhYcpfwIX86Rd0MG74_VN87x_oAHOKq2cGQ0vYZsUCH7unulUi6gcaaxdIQdJSL9B4FJAFesCoxUaACZ7DRLbevc/s1600/paging_bg2.png) no-repeat;
display: none; /*--Hidden by default, will be later shown with jQuery--*/
}
.paging a {
padding: 5px;
text-decoration: none;
color: #fff;
}
.paging a.active {
font-weight: bold;
background: #920000;
border: 1px solid #610000;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
}
.paging a:hover {font-weight: bold;}


Change the size - I currently have the size set to 500x250 as highlighted in the code above.You can change this to make it bigger and remember that size is also the size of the images you add.


Step 4. Find the following piece of code in your blogs Html : (Click Ctrl and F for a search bar to help find the code - More Info)


</head>


Step 5. Copy and Paste the following code Directly Above / Before </head>


<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>


$(document).ready(function() {


//Set Default State of each portfolio piece
$(&quot;.paging&quot;).show();
$(&quot;.paging a:first&quot;).addClass(&quot;active&quot;);


//Get size of images, how many there are, then determin the size of the image reel.
var imageWidth = $(&quot;.window&quot;).width();
var imageSum = $(&quot;.image_reel img&quot;).size();
var imageReelWidth = imageWidth * imageSum;


//Adjust the image reel to its new size
$(&quot;.image_reel&quot;).css({&#39;width&#39; : imageReelWidth});


//Paging + Slider Function
rotate = function(){
var triggerID = $active.attr(&quot;rel&quot;) - 1; //Get number of times to slide
var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide


$(&quot;.paging a&quot;).removeClass(&#39;active&#39;); //Remove all active class
$active.addClass(&#39;active&#39;); //Add active class (the $active is declared in the rotateSwitch function)


//Slider Animation
$(&quot;.image_reel&quot;).animate({
left: -image_reelPosition
}, 500 );


};


//Rotation + Timing Event
rotateSwitch = function(){
play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
$active = $(&#39;.paging a.active&#39;).next();
if ( $active.length === 0) { //If paging reaches the end...
$active = $(&#39;.paging a:first&#39;); //go back to first
}
rotate(); //Trigger the paging and slider function
}, 7000); //Timer speed in milliseconds (3 seconds)
};


rotateSwitch(); //Run function on launch


//On Hover
$(&quot;.image_reel a&quot;).hover(function() {
clearInterval(play); //Stop the rotation
}, function() {
rotateSwitch(); //Resume rotation
});


//On Click
$(&quot;.paging a&quot;).click(function() {
$active = $(this); //Activate the clicked paging
//Reset Timer
clearInterval(play); //Stop the rotation
rotate(); //Trigger rotation immediately
rotateSwitch(); // Resume rotation
return false; //Prevent browser jump to link anchor
});


});
</script>


Step 6. Save your template.


That's the Script and Css added to your template to make the slider work now we add the html.


Step 1. OK back to your blogs design page and click Add A Gadget > Choose Html/Javascript :








Step 2. Copy and Paste the following code into the Html/Javascript gadget ;


<div class="container">


<div class="folio_block">


<div class="main_view">


<div class="window">
<div class="image_reel">


<a href="http://www.spiceupyourblog.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx5Gbaw08p5ZVoyeBOOrCd_PCyGy58Q_T1VqQ8imrL5znHpfXOwnwU01cRReHCKL6OjnKAVxGEibsB-KHbQPTGmnWELG12j0n6vlykV8Bb73qtn8BYL6hM4AoFo24jlmyHEBCL192top5e/s1600/slider-image-1.jpg" alt="" /></a>




<a href="http://www.spiceupyourblog.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcNvFI_3poIHci9TL0nV5WxRSGiYVMuJ139pcRrYjXxmuSFBqRN6n-2MCW_vxmcepFJYjNi8HEHUmlAbAL2Z7BlbRwVfX2CbDXq6JKUB_D3TinYsE798_CEH2SRpkKhlU8aKlyQ9x5uPPL/s1600/slider-image-2.jpg" alt="" /></a>




<a href="http://www.spiceupyourblog.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9-8mrduC0YRxvC2z107u3NMzMeHJL147Pb43IKrGnH8I0Y374bJj_wcr1Hf9quDfKs0QzR2yKOwdU_exV8ET61IRiqZfVHkXs-ix5Qc4e1fK1Y5FNfMNPxSny_axtP_c1l0b4sT0lr7E4/s1600/slider-image-3.jpg" alt="" /></a>




<a href="http://www.spiceupyourblog.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd6uJRy0ig0oef2C85J83QR26fxO5GYvVLtYt6TPQa01-ZKuJZqRiY6NraLC_98jMOLieJzxuyM5wderbN4CYOCaPidiIaLb50FyFVlqauipWTj0Q4gjGz6FTiq00uTY4WCvH7XIlgJE3X/s1600/slider-image-4.jpg" alt="" /></a>


<a href="http://www.spiceupyourblog.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsy4zFPtXYhZ3LizS6Fs-PoCM4aosYEUn8CBbhBkQ92CovOIKksG36JUoeytr-P1-2T2tnDYxdkkugaWf1V3g6c7VLPWta3sOiZv8bNiDPwr0V4ejDnmMljo3Uhl3ObZGPCc7WYTqfmQDu/s1600/slider-image-6.jpg" alt="" /></a>




</div>
</div>
<div class="paging">


<a href="#" rel="1">1</a>
<a href="#" rel="2">2</a>
<a href="#" rel="3">3</a>
<a href="#" rel="4">4</a>
<a href="#" rel="5">5</a>


</div>
</div>


</div>


</div>


Adding Your Slides


Highlighted in red are the URLs this is were the image will lead to when clicked.
Highlighted in green is the Image URLs replace these with the URLs of your images.


To add more than 5 slides simply add another link and image the same as the ones there now.But make sure to add another number to the pager highlighted in blue.So at the moment there are 5 slides and the pager in blue goes to 5.If you added a 6th slide you would add it like this :


<a href="#" rel="6">6</a>


Once you have your images and links added save the gadget and drag and drop it into position.


That's your simple jQuery slider added to Blogger.


Drop your Comments and Questions below.

0 komentar:

Posting Komentar