Add A Simple Image/Photo Gallery To Blogger

This tutorial will show you How To Add A Simple Image/Photo Gallery To Blogger With Easy Customization Options. This is a simple image slider with lots of customizing options such as dimensions, play, pause, interval between next and previous slide and some other options. This Image gallery was created by dynamicdrive.com





Simple Image/Photo Gallery Demo



LIVE DEMO


How To Add A Simple Image/Photo Gallery To Blogger


  • Go to Blogger Dashboard --> Layout --> Add A Gadget
  • Select HTML/Javascript and paste the code shown below in it


<style type="text/css">
#simplegallery1 {
    //CSS for sample Gallery
position: relative;
    visibility: hidden;
    border: 5px solid black;
    margin: auto;
}
#simplegallery1 .gallerydesctext {
    //CSS for description DIV of Example 1 (if defined)
text-align: left;
    padding: 2px 5px;
    font-family: calibri;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://latest-hacks.googlecode.com/svn/gadgets/Sliding Description Panel/imagegallery.js">
</script>
<script type="text/javascript">
var mygallery=new simpleGallery({
 wrapperid: "simplegallery1", //ID of main gallery container,
 dimensions: [400, 265], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
 imagearray: [
  
       ["IMAGE LINK 1", "#", "_new", "IMAGE DESCRIPTION"],

       ["IMAGE LINK 2", "#", "_new", "IMAGE DESCRIPTION"],

       ["IMAGE LINK 3","#", "_new", "IMAGE DESCRIPTION"],

       ["IMAGE LINK 4", "#", "_new", "IMAGE DESCRIPTION"],

       ["IMAGE LINK 5", "#", "_new", "IMAGE DESCRIPTION"]
 ],
 autoplay: [true, 2500, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
 persist: true,
 fadeduration: 1000, //transition duration (milliseconds)
 oninit:function(){ //event that fires when gallery has initialized/ ready to run
 },
 onslide:function(curslide, i){ //event that fires after each slide is shown
  //curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML)
  //i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc)
 }
})
</script>
<div id="simplegallery1"></div>

WIDGET CUSTOMIZATION

  • Resize all your images to a fixed dimension
  • To change the dimension of the slide edit 400 and 265 where  represents the 400 width and 265 represents height
  • Replace IMAGE LINK with the link of the images you want to add in slider
  • Replace # with the link that you want to add to the image (When user click on that image it goes to a particular post)
  • In place of IMAGE DESCRIPTION add the description of the image. Ifd you don't want to add then delete IMAGE DESCRIPTION
  • By default the autoplay of the gallery is on if you want to turn off the autoplay the change true to false
  • To change the time interval of the slides then edit 2500

Like it? Share it.

12 comments

18 July 2012 at 13:22

can i add it in a post??? if yes how??? and i sent you a mail... please look at it...

19 July 2012 at 02:15 Author

@Em Ji Madhu Add the whole code above </head> tag but dont add this line <div id="simplegallery1"></div> Now to add it in a post go to Edit HTML then paste this line <div id="simplegallery1"></div>

19 July 2012 at 21:56

@sonu thanks for the reply... but whenever i repeat the code in post... those 5 images only repeatedagain... lets say, i want to poost this widget on all my post... can it be possible???

20 July 2012 at 03:04 Author

@Em Ji Madhu Add this code in your post by clicking on Edit HTML
<script type="text/javascript">
var mygallery=new simpleGallery({
wrapperid: "simplegallery1", //ID of main gallery container,
dimensions: [400, 265], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
imagearray: [

["IMAGE LINK 1", "#", "_new", "IMAGE DESCRIPTION"],

["IMAGE LINK 2", "#", "_new", "IMAGE DESCRIPTION"],

["IMAGE LINK 3","#", "_new", "IMAGE DESCRIPTION"],

["IMAGE LINK 4", "#", "_new", "IMAGE DESCRIPTION"],

["IMAGE LINK 5", "#", "_new", "IMAGE DESCRIPTION"]
],
autoplay: [true, 2500, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
persist: true,
fadeduration: 1000, //transition duration (milliseconds)
oninit:function(){ //event that fires when gallery has initialized/ ready to run
},
onslide:function(curslide, i){ //event that fires after each slide is shown
//curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML)
//i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc)
}
})
</script>
<div id="simplegallery1"></div>

and the remaning code in your template

21 July 2012 at 11:15

@sonu thank you so much for your reply... but its not working... i applied those jquery and css script before /head and the code which you gave in my post... but its not showing... im sorry... why??

21 July 2012 at 11:28 Author

@Em Ji Madhu You have done something wrong. Have you put the code in Edit Html tab when you write a post

1 August 2012 at 21:51

@sonu yeah i put the code in edit html only...

23 September 2012 at 13:50

Very Good And helpful articles....http://paksas.blogspot.com/


As my blog improved thanks

25 October 2012 at 05:25 Author

I want to add this widget in individual posts. I tried codes in above comments. But nothing worked. I want to add different images to different posts. How can i do it? My site: Free Android App Shop

25 October 2012 at 08:45 Author

@Sebin Thomas See my reply to Em Ji Madhu

25 October 2012 at 09:22 Author

@sonu I tried it, But not worked :(

25 October 2012 at 11:31 Author

@Sebin Thomas I had test it again, its working, check this http://mybloggertoolsdemo.blogspot.in/2012/10/testing-post.html

Click to Add a New Comment

  • If you're asking a question click on Subscribe By Email link, on the comment form, to be notified of replies.
  • Do NOT add links to the body of your comment as they will not be published.
  • Only the comments posted in ENGLISH will be approved.
  • If you have a problem check first the comments , maybe you will find the solution there.