1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=1240; initial-scale=0; maximum-scale=1.0; user-scalable=1;">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<!-- Stylesheets ============================================= --> <link rel="stylesheet" href="css/style.css" type="text/css" />
<!-- External JavaScripts ============================================= --> <script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
<!-- Document Title ============================================= --> <title><?=$site_info["companyname_".$langcode]?></title> <meta name="keywords" content="<?=$site_info["metakeyword_".$langcode]?>"> <meta name="description" content="<?=$site_info["metadescription_".$langcode]?>">
<!-- for scroll menu -->
<script type="text/javascript"> function check_if_able_scroll_left(){ //scroll 1px to the left $(window).scrollLeft(1); if($(window).scrollLeft() != 0){ //alert('there is a horizontal scroll bar you must have a small screen'); $(window).scrollLeft(0); return true; }else{ //alert('there is NO a horizontal scroll bar'); $(window).scrollLeft(0); return false; } }
var able_scroll_left = false;
$(function () { able_scroll_left = check_if_able_scroll_left(); });
$(window).resize(function () { able_scroll_left = check_if_able_scroll_left(); });
$(window).scroll(function() { $("#header").scrollLeft($("body").scrollLeft()); $("#header").scrollTop($("body").scrollTop());
//1 if ($(window).scrollTop() > 0 && !able_scroll_left){ //$('#header').animate({top:$(window).scrollTop()},0,"liner"); $("#header").css("position", "fixed"); //$("#header").css("top", $(window).scrollTop()+"px"); $("#header").css("top", "0"); $("#header").css("border-bottom", "1px solid #c3c3c3"); //console.log(1);
}else{ $("#header").css("position", "absolute"); $("#header").css("top", $(window).scrollTop()+"px"); $("#header").css("border-bottom", "none");
//console.log(2); }
}); </script>
|