• Menu
  • Lycoris
  • Category
    • Animation
    • Nature
    • People
    • Technology
    • Vogue
    • Other
  • Tools
    • CSS
    • jQuery
    • Cookies
    • Wicked
  • Menu
    • CSS
    • jQuery
    • Cookies
    • Wicked
  • Sub Menu
    • CSS
    • jQuery
    • Cookies
    • Wicked

Top Free IT

Share free template blogger

  • Home
  • Contact
  • Sitemap
  • Static Page
Menu
How to Image Gallery How to Add Image Gallery with Thumbnails to Blogger

How to Add Image Gallery with Thumbnails to Blogger

How to Add Image Gallery
For those who would like to show pictures in an image gallery, here's a gallery made with JavaScript and CSS that includes some thumbnails with which you will be able to pick different images on mouse click.
LIVE DEMO

With the help of CSS, we can then place the <img> element to make it appear at the same position for each thumb and we'll be able to style the thumbnails as small blocks with a defined height/width. The script will add a click-event for each <li> object that changes it's child's <img> visibility and assigns an "active" class name to the <li>.

Step 1. Log in to your Blogger dashboard, go to Template > Edit HTML
Step 2. Click anywhere inside the code area and press the CTRL + F keys to open the Blogger search box
Step 3. Inside the search box type </head> and click enter to find it.
Step 4. Now pick one of the styles below and copy the code below it:

<style type='text/css'>#image-gallery {display: none;}#jquery-gallery {padding:0;margin:0;list-style: none; width: 500px;}#jquery-gallery li {width:84px; height: 80px;background-size: 100%;-webkit-background-size: cover;-moz-background-size: cover; -o-background-size: cover;background-size: cover;margin-right: 10px; border: 3px solid #fff; outline: 1px solid #E3E3E3; margin-bottom: 10px;opacity: .5; filter:alpha(opacity=50); float: left; display: block; }#jquery-gallery li img { position: absolute; top: 100px; left: 0px; display: none;}#jquery-gallery li.active img { display: block; border: 3px solid #fff; outline: 1px solid #E3E3E3; width:490px; max-height: 375px;}#jquery-gallery li.active, #jquery-gallery li:hover { outline-color: #DFDFDF; opacity: .99;filter:alpha(opacity=99);}</style>
  

 Style 2

<style type='text/css'>
#image-gallery { display: none; }
#jquery-gallery {padding:0;margin:0;list-style: none; width: 200px; }
#jquery-gallery li {background-size: 100%;-webkit-background-size: cover;-moz-background-size: cover; -o-background-size: cover;background-size: cover;margin-right: 10px; width: 80px; height: 80px; border: 3px solid #fff; outline: 1px solid #ddd; margin-right: 10px; margin-bottom: 10px; opacity: .5;filter:alpha(opacity=50); float: left; display: block; }
#jquery-gallery li img { position: absolute; top: 0px; left: 200px; display: none; }
#jquery-gallery li.active img { display: block; width:370px; border: 3px solid #fff; outline: 1px solid #E3E3E3; }
#jquery-gallery li.active, #jquery-gallery li:hover { outline-color: #bbb; opacity: .99;filter:alpha(opacity=99);}
#gallery-caption {background: rgba(0, 0, 0, 0.3);color: #fff;font-size: 16px;font-weight: bold;text-transform: uppercase;margin: 0 -17px;position: absolute;right: 0;text-align: center;top: 3px;width: 370px;}
</style>

Note: The display: none; of the first ID (#image-gallery) is to prevent images appear with their actual size before they go inside the gallery container, this is while loading the code. In #jquery-gallery we have the width of the container for the thumbnails (200px), so that they display in two rows and for this we need to count the width of the thumbnail (80px) plus the margins between them. The left declaration of #jquery-gallery li img is to move the larger thumbnail that shows on mouse click so that it won't overlap with the smaller thumbnails.

Step 5. Paste the code that you copied earlier just bellow the </head> tag.

Step 6. Just above the same </head> tag, add this script:

<script type='text/javascript'>
//<![CDATA[
var gal = {
init : function() {
if (!document.getElementById || !document.createElement || !document.appendChild) return false;
if (document.getElementById('image-gallery')) document.getElementById('image-gallery').id = 'jquery-gallery';
var li = document.getElementById('jquery-gallery').getElementsByTagName('li');
li[0].className = 'active';
for (i=0; i<li.length; i++) {
li[i].style.backgroundImage = 'url(' + li[i].getElementsByTagName('img')[0].src + ')';
li[i].title = li[i].getElementsByTagName('img')[0].alt;
gal.addEvent(li[i],'click',function() {
var im = document.getElementById('jquery-gallery').getElementsByTagName('li');
for (j=0; j<im.length; j++) {
im[j].className = '';
}
this.className = 'active';
});
}
},
addEvent : function(obj, type, fn) {
if (obj.addEventListener) {
obj.addEventListener(type, fn, false);
}
else if (obj.attachEvent) {
obj["e"+type+fn] = fn;
obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
obj.attachEvent("on"+type, obj[type+fn]);
}
}
}
gal.addEvent(window,'load', function() {
gal.init();
});
//]]>
</script>
Basically what this script does is to look if there is any ID named "image-gallery" and get the different list items that may exist within it. These elements will be displayed as thumbnails and a function will decide what to do when they are clicked. So, each time we click on a thumbnail, the "active" class will be assigned and the thumbnail should be visible in a larger container.

Step 7. Save the changes by clicking on the Save template button.

And finally, here's the HTML code. This is a normal list with the image-gallery ID, enclosed within a DIV with a relative position to avoid side effects of other pre-existing positions.

Step 8. Paste the below HTML to where you want to display the gallery by going either to Layout and adding a new gadget (click on the Add a gadget link and choose HTML/JavaScript), or inside a post or page within the HTML section.

<div style="position:relative;">
<ul id="image-gallery">
<li><img src="IMAGE-URL1" /></li>
<li><img src="IMAGE-URL2" /></li>
<li><img src="IMAGE-URL3" /></li>
<li><img src="IMAGE-URL4" /></li>
<li><img src="IMAGE-URL5" /></li>
</ul>
</div>

Note: if elements on your page overlap with this gallery, you might need to add the height declaration after the position: relative; The value of height depends on the size of your gallery.


Example:


 <div style="position:relative; height: 500px;"> 


Change IMAGE-URL1 with the image URL.

<div style="position:relative;">
<ul id="image-gallery">
<li><a href="page-URL"><img src="IMAGE-URL1" /></a></li>
<li><a href="page-URL"><img src="IMAGE-URL2" /></a></li>
<li><a href="page-URL"><img src="IMAGE-URL3" /></a></li>
<li><a href="page-URL"><img src="IMAGE-URL4" /></a></li>
<li><a href="page-URL"><img src="IMAGE-URL5" /></a></li>
</ul>
</div>


Here you need to replace the page-URL text with the URL of your page/post
Few tips:

To add space for more rows, increase the 100px value from this line:
#jquery-gallery li img { position: absolute; top: 100px; left: 0px; display: none;}

Save your widget and Happy Blogging.

Unknown
Add Comment
How to, Image Gallery
Thursday, October 8, 2015
  • Share
  • Share

Related Posts

  • How to Add “lang” Attribute to a Blogger TemplateAdding the "lang" attribute into the html tag specifies the default language of the website's conte
  • How to install "Back to the Top" button with smooth scrollingThis is really  great thing for the long posts, articles or whatever you have on your blog / w
  • How to Add Jumbo Social Share Bar with Counters in BloggerAre you looking to add a Jumbo social share bar in Blogger? Why it is called a Jumbo Social Bar? Wh
  • How to Add jQuery i CSS3 Magnifying Glass Idea came by surfing web and saw on some site how they made this awesome effect. There is similar e
  • How to Create a Demo Page with Download/Demo Buttons Toolbar on BloggerBlogger platform always stands at the top for best user interface. Many features are not inbuilt in
  • How To Add Related Posts Widget To Blogger with Thumbnails Here is a wonderful hack for displaying related posts beneath each of your blog posts, along with t

Newer Older Home
Lycoris Responsive Blogger Template

Lycoris Responsive Blogger Template

Mauris mattis auctor cursus. Phasellus tellus tellus, imperd…

Most Awesome Breathtaking Places

Most Awesome Breathtaking Places

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sat…

Overall of Fashion Week

Overall of Fashion Week

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sat…

Awesome Fashion Trend in For Winter

Awesome Fashion Trend in For Winter

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sat…

7 Ways To Travel Like a Pro

7 Ways To Travel Like a Pro

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sat…

<12345>

Weekly Posts

  • thumbnails
    Viralisme
  • thumbnails
    How to Create Rounded Images with CSS
  • thumbnails
    Strap Blog
  • thumbnails
    Viral Pro
  • thumbnails
    Swift Blogger Template
  • thumbnails
    Power Game

Label

1 Column 2 Column 2016 2017 3rdball 3rdbell Acacia Active Mag Ad Mag Adelle Adello Admiral Tumblr Theme Ageka Simple Agista Ajustmag Alice Allure Amadeus aMag Amalie Amazine AMP Template AnankeMag Anime Anime Clean AnimeBatch AnimeMagzs AnimePacker Animeplus AnimeTango Arden Argent Arlinadesign Asteroid Astonish Author Widget Authority Auto Razz Auto Read More Autumn Avocet AwesomeOne Axact Back To The Top Barbar Base Beauteous 2016 Beauty BeautyTemplates Beehive Best Mag Better Mag BizDesk BizGlobe Black Black Cover Blacken BLagioke Blogable Blogari Blogger Blogger Magazine Blogger Template Blogger Templates Blogger Widgets Bloggertheme9 Blogghiamo Blogging Blogish Blogius Blogmag BlogrCart BlogrCart Closet v2 BlogrCart Mukabuku Blogrcart One BlogrCart SHOWCASED BlogrCart White2 BlogrShop Blogstar Blogus Blue Blue APK BlueTheme Blush Bmag BoldNews Bolina Brosense Brown Brownie Bthemez Bulan Busby Bushwick Business Businis Button Buttons Calypso Canvas Clock CarsPortal Cartoons CarZilla CB Blog Foto CelebVision ChicMag Chitoge Attack Claire Clothing CocoMag Colorindo Coming soon Conversion Cool Mag Coolbaby Cooperate Coral Drive Corner Mag Cosparell Count Me Couture Creative CreativePen Crystal CSS CSS3 CTR Booster Daily Health DaisyChain Daksh Dark Color DarkMag Date A Live Davis Dearpins Decent Deep Blog Defersite Delivery Lite Demo Page DeNews Design and CSS DesignIdea DesignPress Detube Deverclean Devil Survivor Devote Devotion Grid Discover Djogzs Dollar Sense Domag Download Buttons DreamLine Drop Down Menu Dropen Duena Duos Mag Dzine Easy Blog Easy Mag EasyMag Edogawa Education EducationPro Effective eLearn Elegantes Eleganto eNewspaper Estelle Evo Magz Exmanga ExpressNews Extra News Fabish Facebook Fag Mag Familia Fan Base Fanbase v2.2 Fancy Fanstrap Anime Fantasy Fasel News Fashion Fashion Blogger Template Fashionistas Fashionly Fast 2 Fast Edition Fast Gear fastnews Feedly Felice Fenomen Figaro Film Reviews Final Fantasy Fitness Diva Flashback FlatMag Flatness Flavio Flavio Simple Flexmag Flytemplate Food Food Blog Foodlicious FootballZone Foto Fotografity Foundia Free Blogger Template Free Premium Fresh Blog Fresh View Frontier Fusion G Vusion Gallery GameDaily GameFusion GameMag GameMaster Gameport Gamer Games GamesExpo GamesNet GamesPad GamingCenter Gear World GeoWall GirdBook Gladiolus Minimal Glam Up Glamour Glooger Gommero Gordon Gossip Gracious Gray GreatMag Green Green APK Pro GreenMag Grey Grid Template Gridisme Gumi Vocaloid Gym Happenings HaralampiLux Harmonia Hatsune Miku Headlines Health Health/Fitness HealthDaily HealthLab HealthPro HealthyLiving HeradinoMag HestiaMag HighEnd Hitamz Holomatic Honey HorseMag HostingBlog Hotmag How to HTML HugeMag iBeats Image Image Gallery Immersed iMoechan Impreza Indzign Ingrid Instaset Instinct Intent Invert Invert Grid Invision Iori Kyun iPrime iPro Irsah Ivanesia Ivero Iwata JalanTikus Jax Lite Jaximus Jenny Johansen JosePhine JoyFul Fashion JPStation jQuery JQuery Widgets Jugas Jumper Jupiter Kalimaz Kalon KitKat Klarity Koenda Kompi Landing Page Kompi Males Kontify Krakatau Lite Kuro Simple Kyoukai no kanata Lady Finger Lagicapek Landing Page Language Attribute Ledera Lemy LepontoMag Life-Fashion LifeBlog Lifestyle Lifestyle Magazine Limelight Livinia LocalNews Loveria LunaMag Lux News Mag Zilla Magazine Magazine Template Magcro Parallax Magento Magnifique Magnifying Glass MagOne MagtiMate MagTime MagWeb Magzima Marble Mashable Maskolis Masterpiece MaterialZine MaxaZine MaxTemplate Maya McKinley Mdcsite MDFostrap Meed Mega mag Mega Shop Mega Social Menowo MetroMag Micro Mag MicrownSoft Grid Milano Mini-T Minima Minima Colored Minimal Minimalist Mistery MNMLIS MobileZone Modern ModernMag Monal Montric Motive Mag Moveone Movie MovieSpot msdesignbd mSora Mugi Mularonis Multimedia MultiPurpose Blogger Template My Mag MyRestaurant Mystery N Light Nami Press Nanopress Navigation Menu Neda NeedMag Neo Mag NEOMAGz Netia New Minima Colored NewBloggerThemes NewMag NewNews NEWS News 52 News24 NewsBoard NewsCenter NewsGrand Newsly Newspaper NewsPark NewsPro NewsTube NewsZoom Nimbus Nisekoi Novelo Nubie Banget Ocean Mag Odd Themes Old Themes Older Themes Olive Olivia One Page OneStream OnlineMagazine OpenNews Oracle Orange Ore no Imouto Oreki Houtarou Origins Otaku News Ovation Overload Padhang Pago Pakdhe Johny Palki Palki 2 Palki Grid Palki Ultimate Particular Responsive PBT PBThemez Perish Personal Personal Blog Personal template Photo Photographer Blogger Template Photography Phrozen2 Picshots Picture Pink Pinterest Pointer Portfolio Power Game Powered by Blogger Precious Lite Preloading Effect Premium Premium Themes PremiumBloggerTemplates PressMania Pro Templates Lab Probama ProMag ProNews ProNewspaper Publisher Purple Raintemplates Raintimes Raspberry Rastolinos Read More Readily Reading Red ReDesign Related Posts Responsive ReStyle Revelio Rezero Chan Risa RokoPhoto Rosemary Scoop Scratch SeeNews Sense Seo Beast Blogger Templates Seo Boss seobloggertemplates Seofast Setiva Shine Shingeki No Kyojin Shiroi Shop Template Silver Simplart Simple Fast Simple Sense SimpleBuzz Simplesanget Simplest Simplex Simplex Audio Simplify Simply Mag Sincup Singl Sleekify Slider Smart Blog Smart News SmartBlog Smartseo SNews Snowseo Social Icons Social Share Buttons SocialMediaMarketing Socio SoftWind Solar Solon Soone Soonex Sora Sora Book Sora Buzz Sora Films Sora Games Sora Mag Sora Travels Sparkle Sparkling Splendid Splendor 2 SpotCommerce Spraymag Square StagoMag Strength Studio Stylish Subscribe to Subscription Box Sugar SunMag Sure APK SweeTravel Swift Takis Team Blog Tech Tech Life Tech Mag Tech World TechBlog TechGo TechJournal TechLand Technext Technology TechPro TechTrend TechUp TechZine Template TemplateClue Templateify Templateism Templatesyard Templatetrackers Templatezy Templatium Templatoid The Blog Theme The Dens The Reviewer TheAcademy TheBloopers TheCars Theme Theme Mag Themeforest Themeindie Themeswear Themexpose TheMusic TheNews TheSmart TimesDay Toniq Tooltip TopGames Torrentism Toujours TP Blue Mag Travel Travel Blog Travel Hub TravelHub Treasury Trendmag Trendy Divaa Tribes Tribute TriVusion Trophy Tubies Tumblr Ultimate Tech Under Construction UniEdu Uong Jowo UpMag UpStream Usagilabs Vacations Value Veethemes Verda Vidal Video VideoPro VideoShow Vienna Vienna Lite 2 Vienna Lite 3 Vikka VipMag Viral Mag Viral Pro Viral Ta ViralNews Vogue 2016 Voux Wallbar Warm Mag way2themes Weblogtemplates Wedding White Widget Widgets Wizzblue WorldGamer WpHealth WPNewsPaper Writer Writer Evolution X-Man XPress News Yellow YesNews Yo MAG Yo Templates YouMusic YouNews Youtube Responsive Blogger Template Zen Mag Zinnias Lite Zippo Zipson Zoom Effect

Recent Post

  • All topics simplify 2 premium for blogger
  • Gravity V3 Responsive Blogger Template
  • Moslar
  • Vox - Responsive
  • Axorys Blogger Template
  • TdbSimple2
  • Viralisme
  • Simple Template
  • AMPNews
  • Digizena

Contact

Name

Email *

Message *

  • Trang chủ

copyright © 2017 Top Free IT All Right Reserved . Created by Idntheme . Powered by Blogger