Headline News Styled Blinking Random Posts Widget For Blogger

Posted by | 12 comments
Headline Styled Random PostsFirst of all, you may wondering what the hell this widget is! So, let me explain this first, you are familiar with news headlines in news channels. Those either come scrolling (vertically or horizontally) or blinking, right? And I know some of you also know about news headline blogger widget. But, what is special in it. This widget have random posts instead of recent posts. 

Second, you must have question in your mind why I have put 'V1" in the last of title. Because I will bring one more random posts widget with scrolling function. Hope you will like both. So, let start the tutorial.

How To Add Headline Styled Random Posts Blogger Widget

1. Go to Blogger > Your Desired Blog > Layout.

2. Click On "Add Gadget" Link. 


3. Now Copy Below Codes and Paste There.

<script type="text/javascript">
var randarray = new Array();var l=0;var flag;
var numofpost=5;function randomposts(json){
var total = parseInt(json.feed.openSearch$totalResults.$t,10);
for(i=0;i < numofpost;){flag=0;randarray.length=numofpost;l=Math.floor(Math.random()*total);for(j in randarray){if(l==randarray[j]){ flag=1;}}
if(flag==0&&l!=0){randarray[i++]=l;}}document.write('<div id="tpb-random-posts"><ul style="display: block; overflow: hidden; height: 20px; list-style-type:none;">');
for(n in randarray){ var p=randarray[n];var entry=json.feed.entry[p-1];
for(k=0; k < entry.link.length; k++){if(entry.link[k].rel=='alternate'){var item = "<li>" + "<a href=" + entry.link[k].href + ">" + entry.title.$t + "</a> </li>";
document.write(item);}}
}document.write('</ul></div>');}
</script>

<script type='text/javascript' src='/feeds/posts/default?alt=json-in-script&start-index=1&max-results=1000&callback=randomposts'></script>

<script type="text/javascript">
this.randomtip = function(){
var pause = 5000;
var length = $("#tpb-random-posts ul li").length;
var temp = -1;   
this.getRan = function(){
var ran = Math.floor(Math.random()*length) + 1;
return ran;
};
this.show = function(){
var ran = getRan();
while (ran == temp){
ran = getRan();
};
temp = rain;
$("#tpb-random-posts ul li").hide();
$("#tpb-random-posts ul li:nth-child(" + ran + ")").fadeIn("fast");
};
show(); setInterval(show,pause);
};
$(document).ready(function(){
randomtip();
});
</script>

4. Save and Done.

Customization

1. If you want to show more than 5 posts, change the highlighted number in the code with red color (it is 5 now).
2. Every blog have different font-sizes, so make sure give it relevant height as for font sizes. You can change blue highlighted code to change its height.

From Editor Side

I think I have completed my tutorial, so go and try it. And most important if the code will not work, don't frustrate, please come here and drop a comment. I will definitely respond as time allow me. Don't worry, every query will be solved. If you want to share this widget on your blog, then you can put a link to this post and drop a comment here to give me credit for this work. I will be there to comment.

12 comments:

  1. The post is nice and informative. I have learned a little after reading the post. Thanks posting this article.

    ReplyDelete
  2. Hello , Abhishek Raj
    Your article are very nice and thanks for your tips. Really it's help me. Thanks Great post. free web hosting

    ReplyDelete
  3. Now-a-days people convey their message to their nearest person with gifts. Send Flowers to India online along with gifts easily and with delivery promise for your dear ones and connect yourself to those people residing at different parts of the country. At our site http://www.indiafloristnetwork.com

    ReplyDelete
  4. This festive season, include in your gifts list these amazing Gift items to render happiness and prosperity to the lives of the people you care about. Send Gifts to Delhi from any online shopping portal containing elements of fun, excitement and happiness.

    ReplyDelete
    Replies
    1. This is really a awesome post. This discussion is really helpful. It will progress the depth of knowledge of reader. So, much happy participating with it. I want to know & learn more. Do , you like to help me?
      (viagra supplier)

      Delete
  5. This festive season, include in your gifts list these amazing Gift items to render happiness and prosperity to the lives of the people you care about. Send Gifts to Delhi from any online shopping portal containing elements of fun, excitement and happiness.

    ReplyDelete
  6. Cheap web hosting in Bangladesh. www.hostthebiz.com

    ReplyDelete
  7. Artikel yang sangat bermanfaat, terima kasih :))
    Agen Casino
    http://goo.gl/Ie7IEb | http://goo.gl/eQV9d3 | http://bit.ly/1sUU8dl | http://pour.pw/957597 | http://goo.gl/CI4bLf | http://goo.gl/lNMX3D
    Agen Bola

    ReplyDelete
  8. Terima kasih infonya :)
    http://clayton88.blogspot.com | http://goo.gl/Ie7IEb | http://goo.gl/eQV9d3 | http://bit.ly/1sUU8dl | http://goo.gl/CI4bLf | http://goo.gl/lNMX3D | http://goo.gl/cAQcMp

    Kumpulan Berita Menarik

    www.Master138.net

    Bandar Bola
    Situs Bola
    Agen Tangkas
    Agen Bola
    Agen Casino Online
    Bandar Casino Online Terpercaya

    www.Indo188.com

    Agen Bola
    Bandar Bola Terpercaya
    Situs Bola Terpercaya
    Bandar Casino Online
    Agen Togel

    www.Axioobet.com

    Agen Casino
    Agen Bola
    Bandar Casino
    Bandar Bola
    Situs Taruhan Bola

    www.Ingatpoker.com

    Agen Poker
    Agen Poker Terpercaya
    Agen Poker Online

    ReplyDelete

  9. great article I loved it, thank you very much for the info and merry Christmas

    ReplyDelete
  10. Artikel yang sangat menarik :D
    http://clayton88.blogspot.com | http://kagumiterus.blogspot.com/ | http://informasiberitatop.blogspot.com | http://bit.ly/1QTpF4S | http://goo.gl/eQV9d3 | http://bit.ly/1sUU8dl | http://goo.gl/CI4bLf | http://bit.ly/1IAMpsv | http://goo.gl/lNMX3D | http://bit.ly/1NM7v7j | http://bit.ly/1VxDjyt | http://bit.ly/1IAMpsv | http://bit.ly/1QTpF4S | http://goo.gl/cAQcMp | http://goo.gl/97Yn1s | http://goo.gl/tw2ZtP | http://bit.ly/1VxDjyt | http://goo.gl/RkuB4G | http://goo.gl/8rM20b | http://goo.gl/5dAkJO | http://bit.ly/1IAMpsv | http://bit.ly/1IAMpsv

    Berita Menarik
    Prediksi Bola
    Kumpulan Berita Menarik
    Kumpulan Berita Campuran
    Bandar Bola
    Agen Bola
    Agen Casino
    Agen Bola Terpercaya
    Main Dominoqq
    Agen Poker
    Bandar Ceme
    Agen Capsa
    Agen Poker Terpercaya

    Terimakasih admin..
    salam kenal ^_^

    ReplyDelete
  11. cool post thanks for sharing...http://www.flashfilesall.com/

    ReplyDelete

About The Author

My photo

Nothing Is Special About Me, But I Can Do Something Special. I Am A Young Blogger Blogging As Part Time And Completing My Education. Well ! I Don't Know Very Much About Myself.

Alexa Rank!

Recent Comments

Contact Form

Name

Email *

Message *