hello guys i am using google ajax feed api to display feed for my site and i am having problem to display the description as a tooltips.

google.load("feeds", "1") 
function rssdisplayer(divid, url, feedlimit, showoptions){
this.showoptions=showoptions || "" 
var feedpointer=new google.feeds.Feed(url) 
feedpointer.setNumEntries(feedlimit) 
document.write('<div id="'+divid+'"></div>')
this.feedcontainer=document.getElementById(divid)
var displayer=this
feedpointer.load(function(r){displayer.formatoutput(r)}) 
}


rssdisplayer.prototype.formatdate=function(datestr){
var itemdate=new Date(datestr)
return "<span style='color:gray; font-size: 90%'>"+itemdate.toLocaleString()+"</span>"
}


rssdisplayer.prototype.formatoutput=function(result){
if (!result.error){ 
var thefeeds=result.feed.entries 
var rssoutput="<ul>"
for (var i=0; i<thefeeds.length; i++){ 
var itemtitle="<a href=\"" + thefeeds[i].link + "\">" + thefeeds[i].title + "</a>"
var itemdate=/date/i.test(this.showoptions)? this.formatdate(thefeeds[i].publishedDate) : ""
var itemdescription=/description/i.test(this.showoptions)? "<span />"+thefeeds[i].content : /snippet/i.test(this.showoptions)? "<span/>"+thefeeds[i].contentSnippet  : ""
rssoutput+="<li>" + itemtitle + " " + itemdate + itemdescription + "</li>"

}
rssoutput+="</ul>"
this.feedcontainer.innerHTML=rssoutput
}
else 
alert("Error fetching feeds: "+result.error.message)
}

This is the function call

<script type="text/javascript">
//USAGE SYNTAX: new rssdisplayer("divid", "rssurl", numberofitems, "displayoptions")
new rssdisplayer("cssdrive", "http://www.cssdrive.com/index.php/news/rss_2.0/", 10, "date")
</script>

I want to make it display the description as a tooltips when i mouseover the feed title/link

Maybe this library will help you in dynamically attaching tooltips to your RSS links.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.