Here I have some panel sand I am showing these panels with a jQuery slide show.

The following is my aspx code:

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="jQueryPanelSlideShow.Default" %>
  2. <!DOCTYPE html>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5. <title>jQuery Panel Slide Show</title>
  6. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  7. <script type="text/javascript">
  8. $(function () {
  9. var $divSlide = $("div.slide");
  10. $divSlide.hide().eq(0).show();
  11. var panelCnt = $divSlide.length;
  12. //Set Slide Show Interval
  13. setInterval(panelSlider, 4000);
  14. function panelSlider() {
  15. $divSlide.eq(($divSlide.length++) % panelCnt)
  16. .slideUp("slow", function () {
  17. $divSlide.eq(($divSlide.length) % panelCnt)
  18. .slideDown("slow");
  19. });
  20. }
  21. });
  22. </script>
  23. </head>
  24. <body>
  25. <form id="form1" runat="server">
  26. <table style="border: solid 4px blue; height: 200px;">
  27. <tr>
  28. <td style="vertical-align: top; background-color: orange; height: 10px; padding: 10px; font-family: Verdana; font-size: 16pt; font-weight: bold; color: blue;">jQuery: Slide Show with Panel in ASP.NET using jQuery
  29. </td>
  30. </tr>
  31. <tr>
  32. <td style="background-color: skyblue;">
  33. <div>
  34. <asp:Panel ID="Panel1" runat="server" class='slide' BackColor="Red" Height="70px">
  35. Welcome to ASP.NET Panel Silde Show
  36. </asp:Panel>
  37. <asp:Panel ID="Panel2" runat="server" class='slide' BackColor="Yellow" Height="70px">
  38. Welcome to world largest online community.
  39. </asp:Panel>
  40. <asp:Panel ID="Panel3" runat="server" class='slide' BackColor="Green" Height="70px">
  41. Post, Share, View online content.
  42. </asp:Panel>
  43. <asp:Panel ID="Panel4" runat="server" class='slide' BackColor="#ff33cc" Height="70px">
  44. Enjoy your online network.
  45. </asp:Panel>
  46. <asp:Panel ID="Panel5" runat="server" class='slide' BackColor="#009999" Height="70px">
  47. Happy to share knowledge.
  48. </asp:Panel>
  49. </div>
  50. </td>
  51. </tr>
  52. </table>
  53. </form>
  54. </body>
  55. </html>
Now run the application:

run
Image 1.

application
Image 2.

run the application
Image 3.

output
Image 4.

jquery
Image 5.

slid show
Image 6.