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.

43 lines
985 B

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("https://jsfeeds.com/feed", {
  15. limit: 15,
  16. layoutTemplate: "{entries}",
  17. entryTemplate:
  18. "<div class='entry'><h3>{title}</h3><div><p>{bodyPlain}</p></div></div>",
  19. success: function() {
  20. $(".entry").each(function(i, entry) {
  21. $(entry).slideDown();
  22. });
  23. }
  24. });
  25. });
  26. </script>
  27. <style>
  28. .entry {
  29. display: none;
  30. }
  31. </style>
  32. </head>
  33. <body>
  34. <div>
  35. <h1>jquery.rss example</h1>
  36. <div id="rss-feeds"></div>
  37. </div>
  38. </body>
  39. </html>