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.
 
 
 
 
 
 

233 lines
9.4 KiB

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs" Inherits="OT.Web.MainPage" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title id="Title1" runat="server">TmpWeb系統</title>
<%--<link rel="shortcut icon" type="image/x-icon" href="App_Themes/Default/images/favicon.ico" />--%>
<link href="App_Themes/Common/OTKTAB/jquery-ui-OTKTAB.css" rel="stylesheet" type="text/css" />
</head>
<body id="mainbody" runat="server">
<!--選單視窗-->
<div id="OTK_slider_scroll" style="position: absolute; z-index: 9999;">
<!--修正IE9以前MENU無法正常顯示 Modify by Gary 2014/04/29-->
<div id="OTK_menu_tab" style="display: none">
<span>項</span><span>目</span><span>選</span><span>單</span></div>
<div id="OTK_slider_content">
<iframe id="OTK_menu_iframe" src="./Menu.aspx" scrolling="no" frameborder="0" style="border: none;
overflow: hidden; width: 200px; height: auto;" allowtransparency="true"></iframe>
</div>
</div>
<iframe id="Iframe1" frameborder="0" scrolling="no" style="overflow: visible; width: 100%;
height: 50px; z-index: 2;" src="./header.aspx"></iframe>
<div class="OTKTAB">
<a id="callmenu" href="#" class="icon-32 icon-menu tabs-icon-menu"></a>
<div id="tabs" class="">
<div class="btn" id="divPrevNext">
<a href="#" id="lbtnPrev" class="icon-arrow-left icon-20"></a><a href="#" id="lbtnNext"
class="icon-arrow-right icon-20"></a>
</div>
<div id="panel" class="panel cms-frame">
<ul class="ui-tab-navbox w80p">
</ul>
</div>
</div>
</div>
<%--設定一個隱藏變數hidValue 是用來判斷Drop Down List 是否為點選。 by Gary 2013/12/31--%>
<%-- <input type="text" id="hidValue" style="overflow: visible;height: 30px; position: absolute; bottom: 500px; left:500px;" value="false" /> --%>
<input type="hidden" id="hidValue" value="false" />
<input type="hidden" id="hidCuryIndex" value="0" />
<div id="divProgramList" runat="server" style="display: none;">
</div>
</body>
</html>
<script type="text/javascript">
<!--
(function ($, sr) {
var debounce = function (func, threshold, execAsap) {
var timeout; return function debounced() {
var obj = this, args = arguments; function delayed() {
if (!execAsap)
func.apply(obj, args); timeout = null;
}; if (timeout)
clearTimeout(timeout); else if (execAsap)
func.apply(obj, args); timeout = setTimeout(delayed, threshold || 500);
};
}; jQuery.fn[sr] = function (fn) { return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
})(jQuery, 'smartresize');
$(window).smartresize(function () {
var headheight = $('#Iframe1').height(); //表頭高度
var footheight = 5; //表尾高度
var tabheight = $('#panel').height(); //Tab高度
var totalheight = document.body.offsetHeight; //頁面高度
var iframeheight = totalheight - footheight - headheight; //iframe高度
$("iframe").each(function () {
var src = $(this).attr('src').toString();
if (src.indexOf("Page") !== -1 || src.indexOf("ModuleDefault") !== -1)
$(this).css('height', (iframeheight - tabheight - 16) + 'px');
});
$('.tabdiv').css('height', (iframeheight - tabheight - 16) + 'px'); //iframe 裡面的高度
$('#tabs').css('height', (iframeheight) + 'px');
$('#OTK_menu_iframe').css('height', (totalheight - footheight - 60) + 'px'); //比總高再少一小格
$('#OTK_slider_content').css('height', (totalheight - footheight - 20) + 'px').animate({ height: totalheight - footheight - 20 });
$('#OTK_slider_scroll').css('height', (totalheight - footheight - 20) + 'px').animate({ height: totalheight - footheight - 20 });
//2013/11/26dean 計算寬度 並且移動到可以看到頁簽
$('.ui-tabs-nav').css('width', $(window).width() - 250); //重設寬度 要不然會爆掉
$('#content-box').animate({ height: iframeheight }).contents().find('body').scrollTop(0);
})
$(window).load(function () {
//高度重整
var headheight = $('#Iframe1').height(); //表頭高度
var footheight = 0; //表尾高度
var tabheight = $('#panel').height(); //Tab高度
var totalheight = document.body.offsetHeight; //表尾高度
//var iframeheight = totalheight - footheight - headheight - tabheight; //iframe高度
$('#OTK_menu_iframe').css('height', (totalheight - footheight - 60) + 'px'); //比總高再少一小格
$('#OTK_slider_content').css('height', (totalheight - footheight - 20) + 'px');
$('#OTK_slider_scroll').css('height', (totalheight - footheight - 20) + 'px');
// $('#Operation').animate({ height: iframeheight }).contents().find('body').scrollTop(0);
//寬度重整
var width = $(document).width();
$('.ui-tabs-nav').css('width', width - 250);
})
///左移
$("#lbtnPrev").click(function () {
SetCurryIndex(-1);
});
///右移
$("#lbtnNext").click(function () {
SetCurryIndex(1);
});
//製作左邊選單移動動作
var hh = document.body.offsetHeight - 50;
var w = $("#OTK_slider_content").width();
$('#OTK_slider_content').css('height', (hh) + 'px');
$("#OTK_menu_tab").mouseover(function () {
if ($("#OTK_slider_scroll").css('left') != '0px') { //OTK_slider_scroll顯示時left=0px,這裡設定是讓顯示時就不在執行。Modify by Gary 2014/4/29
$("#OTK_slider_scroll").animate({ left: '0px' }, 600, 'swing');
}
});
$("#callmenu").click(function () {
if ($("#OTK_slider_scroll").css('left') != '0px') {
$("#OTK_slider_scroll").animate({ left: '0px' }, 600, 'swing');
}
});
//當滑鼠在OTK_slider_content上時,hidValue呈現false。
//hidValue 是用來判斷Drop Down List 是否為點選。 by Gary 2013/12/31
$("#OTK_slider_content").mouseover(function () {
$('#hidValue').val("false");
});
//當滑鼠在window上且hidValue呈現true時,讓OTK_slider_content縮回。 Add by Gary 2014/2/7
$(window).mouseover(function () {
if ($('#hidValue').val() === 'true') {
$("#OTK_slider_scroll").animate({ left: '-' + w + 'px' }, 600, 'swing');
$('#hidValue').val("false");
}
});
//當滑鼠移開OTK_slider_content時,判斷hidValue是否為true,如果為TURE則不縮滑動畫面,
//hidValue 是用來判斷Drop Down List 是否為點選。
//用意是避免IE瀏覽測當選到DropDownList時會直接縮滑動畫面。 by Gary 2013/12/31
$("#OTK_slider_content").mouseleave(function () {
if ($('#hidValue').val() !== 'true') {
$("#OTK_slider_scroll").animate({ left: '-' + w + 'px' }, 600, 'swing');
}
});
document.onkeydown = function (e) {
var ev = window.event || e;
var code = ev.keyCode || ev.which;
if (code === 116) {
ev.keyCode ? ev.keyCode = 0 : ev.which = 0;
cancelBubble = true;
if (e && e.preventDefault)
e.preventDefault();
else
window.event.returnValue = false;
return false;
}
}
-->
</script>
<script>
<!--
///取需要偏移的大小
function GetLiWidth(intLeftCount) {
//$("#divPrevNext").hide();
var _itemwidth = 0;
//alert(intLeftCount);
$("#panel").find("li").each(function (n) {
if (n <= (intLeftCount) && n !== 0 && n !== ($("#panel").find("li").length - 1)) {
_itemwidth += parseInt($(this).width());
$(this).hide();
$("#divPrevNext").show();
} else {
$(this).show();
}
});
_itemwidth += intLeftCount * 3;
return _itemwidth * -1;
}
///設定當前索引
function SetCurryIndex(intAdd) {
var intCurryIndex = $("#hidCuryIndex").val() * 1;
intCurryIndex = intCurryIndex + intAdd;
if (intCurryIndex < 0) {
intCurryIndex = 0;
}
if (intCurryIndex >= $("#panel").find("li").length - 2) {
intCurryIndex = $("#panel").find("li").length - 2;
}
$("#hidCuryIndex").val(intCurryIndex);
var intLeft = GetLiWidth(intCurryIndex);
//$("#panel").position("relative");
//$("#panel").css('left', (intLeft) + 'px');
return intCurryIndex;
}
-->
</script>
<%--<script type="text/javascript">
window.onbeforeunload = function (e) {
var e = e || window.event;
if (e) e.returnValue = 'Browser is being closed, is it okay?'; //for IE & Firefox
return 'Browser is being closed, is it okay?'; // for Safari and Chrome
};
</script>--%>
<script>
/*攔截F5事件*/
// $(document).keydown(function (e) {
// //alert('123');
// var code = (e.keyCode ? e.keyCode : e.which);
// if (code == 116) {
// alert('123');
// return false;
// }
// });
</script>