You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.1 KiB

4 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>jquery.rss accordion example</title>
  5. <link
  6. rel="stylesheet"
  7. type="text/css"
  8. href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css"
  9. />
  10. <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
  11. <script src="../dist/jquery.rss.min.js"></script>
  12. <script>
  13. jQuery(function($) {
  14. $("#rss-feeds").rss(
  15. [
  16. "https://www.contentful.com/blog/feed.xml",
  17. "http://www.ebaytechblog.com/feed/"
  18. ],
  19. {
  20. layoutTemplate: "{entries}",
  21. entryTemplate:
  22. "<div class='entry'><h3>{title}</h3><div><p>{bodyPlain}</p></div></div>",
  23. success: function() {
  24. $(".entry").each(function(i, entry) {
  25. $(entry).slideDown();
  26. });
  27. }
  28. }
  29. );
  30. });
  31. </script>
  32. <style>
  33. .entry {
  34. display: none;
  35. }
  36. </style>
  37. </head>
  38. <body>
  39. <div>
  40. <h1>jquery.rss example</h1>
  41. <div id="rss-feeds"></div>
  42. </div>
  43. </body>
  44. </html>