Saturday, February 13, 2016

Automated Recent Posts Slider for Blogger


The number of bloggers worldwide has increased tremendously. Many of us would have more than 1 blog. If yes this widget may help you a lot to share the traffic in both the blogs. Even if you don't have more than one blog you may add this widget to your very own blog. This will help your blog have less bounce rate and more pageviews.

Automated Recent Posts Slider is a widget for blogger which will show the recent posts of your desired blog with nice and awesome interface. This widget updates automatically and you do not have to edit the widget and add images, titles and description again and again. You just have to add the URL of the blog and your setup will be complete.
A live demo of this widget can be seen here.

Adding the Widgets code in Blog Layout
In order to add this widget's code go to Blog Title → Layout → Add Widget → HTML/JavaScript and paste the given code in the box opened.

<link rel="stylesheet" type="text/css" href="http://blogger-json-experiment.googlecode.com/svn/resources/blogger-feed-rotator-plugin/default-style.min.css"/><div id="slider-rotator" class="slider-rotator loading"></div><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><script type="text/javascript" src="http://blogger-json-experiment.googlecode.com/svn/resources/blogger-feed-rotator-plugin/blogger-feed-rotator.min.js"></script><script type="text/javascript">makeSlider({    url: "http://YOURURL.blogspot.com" // Add your blog URL});</script>



After adding the code change the URL in Bold Blue with your own desired URL and save the widget. Finally save the template which will make the widget live.

You are done now. Now you and your visitors can see this awesome Automated Recent Posts Slider in your blogger blog.



Thursday, February 11, 2016

How to Create Full Screen Preloading Effect





In this tutorial, We will learn how to create full screen simple,clean preloading effect by html/css/image. Sometimes your website contents taking more times to loading. That's can be frustration of your readers. By adding full screen preloading effect, it can reduce readers frustration.

When readers visit your site, they will see it. Then after full website page content load, it will be removed. You can add it anywhere by choosing any image. We created this script by simple way so that you can understand easily. Read from A to Z carefully.

HTML - You need to add following html code after <body> tags

<div id='preloader'>
   <div id='status'>
      <img alt='' height='64' src='images/preloader.gif' width='64'/>
   </div>
</div>

First div id preloader we used for full page screen background color and Second div id status we used for set up image. You will fully understand when you will see css code. You can replace default preloader image url by creating a new one as your like and replace this default image url from html.


CSS - You need to add following css code in your css file

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #222222;
    z-index: 99999;
    height: 100%;
}
#status {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    padding: 0;
}


Your preloader image size must be 64x64. If your image background color white or other, you can use same color for full page screen from #preloader css code by replacing #222222 background color code.

Javascript - You need to add following javascipt code

/*====================================
  Preloader
======================================*/

 $(window).load(function() {

   $("#status").fadeOut("slow");

   $("#preloader").delay(500).fadeOut("slow").remove();     

 })


$("#status").fadeOut("slow"); This code will first fade out the loading animation.
$("#preloader").delay(500).fadeOut("slow").remove(); This code will fade out the whole DIV that covers the website.


Wednesday, February 10, 2016

How to Add Image Gallery with Thumbnails to Blogger


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.

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 that you like the most, then copy the code associated with it:


Style 1






















          <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);}</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 above 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.



          Sunday, February 7, 2016

          How to Add CSS Animated Share Buttons on Blogger

          Let your blog readers to show their love by sharing your blog post with friends and connection on social networking sites. In this tutorial we will see how to add CSS  animated share buttons on blogger which contains 4 social media share buttons/icon (Facebook, Twitter, Google+ and Pinterest) with cool hover effect. Also you can replace the social networks by changing the links provided below.




          How to Add CSS Animated Share Buttons on Blogger?
          Step 1: Go to Blogger Dashboard> Template > Edit HTML
          Step 2: Press CTRL + F to enable search box, and search for ]]></b:skin> tag.
          Step 3: Just above ]]></b:skin> tag add following code.

          .share_button {
          width: 300px;
          height: 50px;
          margin: 10px auto;
          }
          .share_button ul {
          width: 50%;
          height: inherit;
          float: left;
          list-style: none;
          margin: 0 !important;
          padding: 0 !important;
          }
          .share_button ul h1 {
          margin-top: 9%;
          overflow: hidden;
          width: 100%;
          color: #4889F0;
          font-size: 18px;
          text-shadow:2px 2px 2px #fff;
          }
          .share_button ul li {
          position: absolute;
          height: inherit;
          width: 150px;
          margin: 0 !important;
          padding: 0 !important;
          background: #EEEEEE;
          -webkit-transition: all 600ms;
          -moz-transition: all 600ms;
          -o-transition: all 600ms;
          -ms-transition: all 600ms;
          transition: all 600ms;
          text-align: center;
          }
          .share_button ul li h2 {
          display: inline-block;
          width: 32%;
          height: 40px;
          overflow: hidden;
          margin-top: 5%;
          cursor: pointer;
          border: 0 !important;
          }
          .share_button ul:first-child li:first-child{
          text-align: right;
          }
          .share_button ul:last-child li:first-child{
          text-align: left;
          }
          .share_button ul:first-child li:last-child,
          .share_button:hover ul:first-child li:first-child {
          -webkit-transform: rotateY(90deg);
          -moz-transform: rotateY(90deg);
          -o-transform: rotateY(90deg);
          -ms-transform: rotateY(90deg);
          transform: rotateY(90deg);
          }
          .share_button ul:last-child li:last-child,
          .share_button:hover ul:last-child li:first-child {
          -webkit-transform: rotateY(-90deg);
          -moz-transform: rotateY(-90deg);
          -o-transform: rotateY(-90deg);
          -ms-transform: rotateY(-90deg);
          transform: rotateY(-90deg);
          }
          .share_button:hover ul:first-child li:last-child,
          .share_button:hover ul:last-child li:last-child {
          -webkit-transform: rotateY(0deg);
          -moz-transform: rotateY(0deg);
          -o-transform: rotateY(0deg);
          -ms-transform: rotateY(0deg);
          transform: rotateY(0deg);
          }

          Step 4: Next, Search for the <div class='post-footer'>   - find the second  and paste the following code just above it:


          <div class='share_button'>
          <ul>
          <li><h1>
          Share t
          </h1></li>
          <li><h2>
          <a  expr:href='&quot;http://www.facebook.com/sharer.php?u=&quot; +  data:post.canonicalUrl + &quot;&amp;t=&quot; +  data:post.title ' title='Share on Facebook'><img src="http://2.bp.blogspot.com/-UK3OEVM0cVw/UwJfjtO-exI/AAAAAAAAGPA/CqQmlIlNJAE/s1600/Facebook.png"/></a></h2>
          <h2><a  expr:href='&quot;http://twitter.com/home?status=&quot; +  data:post.title + &quot; &quot; + data:post.canonicalUrl '  title='Share on Twitter'><img src="http://4.bp.blogspot.com/-XyPHPVsfdz4/UwJfkJmI3JI/AAAAAAAAGPQ/QRGykJJtGow/s1600/Twitter.png"/></a></h2>
          </li>
          </ul>
          <ul>
          <li><h1>his page</h1></li>
          <li>
          <h2><a  expr:href='&quot;https://plus.google.com/share?url=&quot; +  data:post.canonicalUrl ' title='Share on Google Plus'><img src="http://3.bp.blogspot.com/-_YGvQ_Nrw10/UwJfjhXOGGI/AAAAAAAAGPU/tv1WNfkHdgg/s1600/Google-plus.png"/></a></h2>
          <h2>
          <a  href='javascript:void((function(){var%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;http://assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)})());'  title='Share on Pinterest'><img src="http://4.bp.blogspot.com/-oZgH_AD169o/UwJfjl3ON0I/AAAAAAAAGPE/BLj5lWbsZyE/s1600/Pinterest.png"/></a>
          </h2>
          </li>
          </ul>
          </div>

          Step 5:  Click on the Save template button and we're done! Enjoy ;)