|
@@ -2,26 +2,18 @@
|
|
|
/* if(screen.width >= 901){
|
|
|
window.location.href = "https://www2.hhh.com.tw/";
|
|
|
} */
|
|
|
-
|
|
|
- let height = (window.screen.width * 2) / 3;
|
|
|
- console.log(height);
|
|
|
- $('.sec-02 .slide-item').css('height', `${height}px`);
|
|
|
- let topHeight = (window.screen.width * 30) / 131;
|
|
|
- console.log(topHeight);
|
|
|
- $('.sec-00 .slide-item').css('height', `${topHeight}px`);
|
|
|
- $('.sec-00 .container-fluid').css('height', `${topHeight}px`);
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-/* window.addEventListener('resize', reportWindowSize);
|
|
|
+ detectDirection ()
|
|
|
+}
|
|
|
|
|
|
-function reportWindowSize() {
|
|
|
- if(screen.width > 480) {
|
|
|
- $('.sec-02 .slide-item').css('height', `130vh`);
|
|
|
- $('.sec-00 .slide-item').css('height', `200px`);
|
|
|
- $('.sec-00 .container-fluid').css('height', `200px`);
|
|
|
- }
|
|
|
-} */
|
|
|
+function detectDirection () {
|
|
|
+ let height = (window.screen.width * 2) / 3;
|
|
|
+ console.log(height);
|
|
|
+ $('.sec-02 .slide-item').css('height', `${height}px`);
|
|
|
+ let topHeight = (window.screen.width * 30) / 131;
|
|
|
+ console.log(topHeight);
|
|
|
+ $('.sec-00 .slide-item').css('height', `${topHeight}px`);
|
|
|
+ $('.sec-00 .container-fluid').css('height', `${topHeight}px`);
|
|
|
+}
|
|
|
|
|
|
$(".sec-01__slider").slick({
|
|
|
dots: true,
|
|
@@ -331,6 +323,7 @@ $(".sec-01__slider").slick({
|
|
|
const navbar = document.querySelector('.navbar-main');
|
|
|
|
|
|
function fixedOnScroll() {
|
|
|
+ detectDirection ();
|
|
|
const sticky = document.querySelector('.sec-00 .container-fluid').offsetHeight;
|
|
|
if(window.pageYOffset >= sticky){
|
|
|
navbar.classList.add('sticky');
|