Tooltips for feed description

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Aug 2008
Posts: 3
Reputation: joemalaya is an unknown quantity at this point 
Solved Threads: 0
joemalaya's Avatar
joemalaya joemalaya is offline Offline
Newbie Poster

Tooltips for feed description

 
0
  #1
Sep 1st, 2008
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.

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1.  
  2. google.load("feeds", "1")
  3. function rssdisplayer(divid, url, feedlimit, showoptions){
  4. this.showoptions=showoptions || ""
  5. var feedpointer=new google.feeds.Feed(url)
  6. feedpointer.setNumEntries(feedlimit)
  7. document.write('<div id="'+divid+'"></div>')
  8. this.feedcontainer=document.getElementById(divid)
  9. var displayer=this
  10. feedpointer.load(function(r){displayer.formatoutput(r)})
  11. }
  12.  
  13.  
  14. rssdisplayer.prototype.formatdate=function(datestr){
  15. var itemdate=new Date(datestr)
  16. return "<span style='color:gray; font-size: 90%'>"+itemdate.toLocaleString()+"</span>"
  17. }
  18.  
  19.  
  20. rssdisplayer.prototype.formatoutput=function(result){
  21. if (!result.error){
  22. var thefeeds=result.feed.entries
  23. var rssoutput="<ul>"
  24. for (var i=0; i<thefeeds.length; i++){
  25. var itemtitle="<a href=\"" + thefeeds[i].link + "\">" + thefeeds[i].title + "</a>"
  26. var itemdate=/date/i.test(this.showoptions)? this.formatdate(thefeeds[i].publishedDate) : ""
  27. var itemdescription=/description/i.test(this.showoptions)? "<span />"+thefeeds[i].content : /snippet/i.test(this.showoptions)? "<span/>"+thefeeds[i].contentSnippet : ""
  28. rssoutput+="<li>" + itemtitle + " " + itemdate + itemdescription + "</li>"
  29.  
  30. }
  31. rssoutput+="</ul>"
  32. this.feedcontainer.innerHTML=rssoutput
  33. }
  34. else
  35. alert("Error fetching feeds: "+result.error.message)
  36. }

This is the function call

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <script type="text/javascript">
  2. //USAGE SYNTAX: new rssdisplayer("divid", "rssurl", numberofitems, "displayoptions")
  3. new rssdisplayer("cssdrive", "http://www.cssdrive.com/index.php/news/rss_2.0/", 10, "date")
  4. </script>

I want to make it display the description as a tooltips when i mouseover the feed title/link
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,609
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 464
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Tooltips for feed description

 
0
  #2
Sep 1st, 2008
Maybe this library will help you in dynamically attaching tooltips to your RSS links.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC