Steps to Add Breaking News Ticker in Blogger

(code Number 1 : Paste In to </body>)


 <script type='text/javascript'>

//<![CDATA[

$(document).ready(function () {

var url_blog = 'PASTE YOUR URL HERE', //replace with your Domain 

numpostx  = 10; //Posts want to display

$.ajax({

url: '' + url_blog + '/feeds/posts/default?alt=json-in-script&max-results=' + numpostx + '',

type: 'get',

dataType: "jsonp",

success: function(data) {

var posturl, posttitle, skeleton = '',

entry = data.feed.entry;

if (entry !== undefined) {

skeleton = "<ul>";

for (var i = 0; i < entry.length; i++) {

for (var j=0; j < entry[i].link.length; j++)

{

if (entry[i].link[j].rel == "alternate")

{

posturl = entry[i].link[j].href;

break;

}

}                posttitle = entry[i].title.$t;

skeleton += '<li><a href="' + posturl + '" target="_blank">' + posttitle + '</a></li>';

}

skeleton += '</ul>';

$('#recentpostbreaking').html(skeleton);

// kode untuk efek pada breaking news

function tick(){

$('#recentpostbreaking li:first').slideUp( function () { $(this).appendTo($('#recentpostbreaking ul')).slideDown(); });

}

setInterval(function(){ tick () }, 5000);

} else {

$('#recentpostbreaking').html('<span>No result!</span>');

}

},

error: function() {

$('#recentpostbreaking').html('<strong>Error Loading Feed!</strong>');

}

});

});

//]]>

</script>




number 2 </head>


<style type='text/css'>

#beakingnews{width:980px;margin:0 auto;line-height:25px;height:25px;background:#F7F7F7;overflow:hidden;margin-top:5px;}

#beakingnews .tulisbreaking{display:block;float:left;padding:0 7px;margin:0 5px 0 0;color:#FCFCFC;background:#5F0000}

#recentpostbreaking{float:left}

#recentpostbreaking ul,#recentpostbreaking li{list-style:none;margin:0;padding:0}

</style>


number 3


<div id='beakingnews'><span class='tulisbreaking'>Breaking News</span><!-- tag pembuka tempat Breaking News-->

<div id='recentpostbreaking'>Loading...</div><!-- tag tempat daftar Breaking News ditampilkan-->

</div><!-- tag penutup tempat Breaking News-->

</b:if></b:if>

<div style='clear: both;'/>




3 comments:

  1. check out the latest news now I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.

    ReplyDelete
  2. The Hiltonian Awares You With Breaking News & The Hiltonian
    Top Stories. Latest Breaking News Like Business, Entertainment, Politics, World and Many More.

    ReplyDelete
  3. Halal Products
    We Provide Halal Products Only!
    All products in our shop are Muslim-friendly, so you can buy with confidence.

    #スパイスショプ - #hiramart - Halal Food in Japan - ヒラマート



    ひらマート

    ハラル製品

    ハラール商品のみを提供!

    当ショップの商品は全てムスリムフレンドリーですので、安心して購入していただけます

    #スパイスショプ - #hiramart - Halal Food in Japan - ヒラマート

    ReplyDelete