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.

111 lines
5.0 KiB

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Header.aspx.cs" Inherits="OT.Web.Header" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head id="Head1" runat="server">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title id="Title1" runat="server">Tour_Back</title>
  7. <style type="text/css">
  8. li { display: inline; }
  9. .slider { width: 500px; }
  10. .list { list-style: none; margin: 0; padding: 0; }
  11. .slider ul { overflow: hidden; position: absolute; left: 430px; top: 16px; width: 500px; }
  12. slider li { float: left; text-align: center; width: 500px; }
  13. .slider label { display: inline-block; overflow: hidden; width: 500px; }
  14. </style>
  15. </head>
  16. <body onload="Refresh();" >
  17. <div id="wrapper">
  18. <form id="Form1" runat="server">
  19. <div id="header" class="cms-frame">
  20. <!--class="cms-frame"-->
  21. <%--<a class="logo">主頁logo圖片***** </a>--%>
  22. <img class="logo" src="App_Themes/Default/images/logo01.png" alt="logo" />
  23. <div class="welcome">
  24. <asp:Literal ID="ltrLoginName" runat="server"></asp:Literal>
  25. (<span id="ltrtime">Watting Loading!!!</span>)
  26. </div>
  27. <div class="slider">
  28. <ul class="list">
  29. </ul>
  30. </div>
  31. <input id="NextLi" type="button" class="displayNone" onclick="ShowNextLi()" />
  32. <ul class="menu right">
  33. <li><a class="icon-user-md" title="個人資料" href="javascript:void(0);" onclick="javascript:parent.open_art('page/Utl/Members_Pop.aspx',600,'member');">
  34. </a></li>
  35. <li><a class="icon-login" title="登出" href="javascript:void(0);" onclick="javascript:top.location.href = '/Login.aspx';">
  36. </a></li>
  37. </ul>
  38. </div>
  39. </form>
  40. </div>
  41. <div style="display:none;">
  42. <iframe id="reloadiframe" src="footer.aspx"></iframe>
  43. <span id="strUserID"><asp:Literal ID="ltrUserID" runat="server"></asp:Literal></span>
  44. </div>
  45. </body>
  46. </html>
  47. <script type="text/javascript">
  48. function Refresh() {
  49. var intminute = parseInt(new Date().formate("mm"));
  50. ltrtime.innerHTML = new Date().formate("yyyy/MM/dd EEE hh:mm:ss"); // 請參考Common.js
  51. if ((intminute % 10) === 0 && parseInt(new Date().formate("ss")) === 0) {
  52. //GetAnnouncementByAjax();
  53. var iframe = document.getElementById('reloadiframe');
  54. iframe.src = iframe.src;
  55. }
  56. setTimeout("Refresh()", 1000);
  57. }
  58. $(document).ready(function () {
  59. //GetAnnouncementByAjax();
  60. setInterval('$("#NextLi").click();', 5000);
  61. })
  62. /********************************************
  63. * 函數名稱:GetAnnouncementByAjax()
  64. * 目的:從WebService讀取公告相關資料,使用Json格式傳回
  65. * 作者:Gary
  66. * 時間:2014/08/11
  67. *********************************************/
  68. function GetAnnouncementByAjax() {
  69. var strWSLocation = '<%=ConfigurationManager.AppSettings["WSLocation"].ToString() %>';
  70. var strURL = strWSLocation + 'GetAnnouncement'; //設定WebService路徑
  71. var strMemberID = strUserID.innerHTML;
  72. $.ajax({
  73. type: 'Post',
  74. url: strURL,
  75. dataType: 'xml',
  76. data: { strMemberID: strMemberID }, //如果要傳送參數,格式如左
  77. success: function (jsonData) {
  78. var strjson = $(jsonData).text(); //取得回傳後的字串
  79. var jsonAry = $.parseJSON(strjson); //把字串解析成Json格式的Array
  80. var intRowCount = jsonAry.length; //取得Array的總數
  81. var liClass = "";
  82. var liHtml = "";
  83. for (intTime = 0; intTime < intRowCount; intTime++) { //跑回圈設定下拉選單總共的值
  84. if (intTime == 0) { liClass = "" } else { liClass = "displayNone" }
  85. liHtml += "<li class='" + liClass + "'><a><label>" + "【" + jsonAry[intTime]['Title'] + "】" + jsonAry[intTime]['Contents'] + "</label></a></li>"
  86. }
  87. $(".slider ul").html(liHtml)
  88. }
  89. });
  90. }
  91. /********************************************
  92. * 函數名稱:ShowNextLi()
  93. * 目的:模擬按下下筆資料
  94. * 作者:Gary
  95. * 時間:2014/08/11
  96. *********************************************/
  97. function ShowNextLi() {
  98. var intCount = $(".status li").length;
  99. var IndexNow = $(".slider ul li.displayNone").index();
  100. if (intCount == IndexNow) { IndexNow == 0 } else { IndexNow + 1 }
  101. $(".slider ul li").addClass("displayNone");
  102. $(".slider ul li").each(function () {
  103. if ($(this).index() == IndexNow) {
  104. $(this).removeClass("displayNone");
  105. }
  106. });
  107. }
  108. </script>