2016-11-05 1 views
0

먼저 (바탕 화면에, 아래로 아래의 웹 사이트를 확장;. 폭 665 픽셀)을 나는 햄버거 메뉴가 있습니다. 그것은 데스크탑에서 "완벽하게"작동하며 "forside"및 "showroom"링크를 클릭하고 (다른 페이지는 아직 업로드되지 않았습니다) 탐색 할 수 있습니다. iPhone SE의 Chrome에서이 작업을 시도하자마자 작동하지 않으며 /homeroom 또는/forside의 URL http://www.munksgaard.com/# insted를 제공합니다.왜 모바일에서 내 햄버거 메뉴로 이동할 수 없습니까? 모바일에 경우에 당신이 볼 수 있듯이 모든 URL (<a href="http://www.munksgaard.one" rel="nofollow noreferrer">http://www.munksgaard.one</a>)</p> <p>의

어떻게 수정합니까? 뭐가 잘못 되었 니?

^이 "forside"에 대한 HTML 우리가 맨 아래에있는 웹 사이트 + jQuery를에 사용하는 CSS 파일이

body { 
 
    font-family: 'Open Sans', sans-serif; 
 
    margin: 0; 
 
    width: 100%; 
 
} 
 
header { 
 
    width: 100%; 
 
    background: none; 
 
    height: 0px; 
 
    line-height: 60px; 
 
} 
 
.logo { 
 
    height: 70px; 
 
    width: auto; 
 
    background: none; 
 
} 
 
.navi { 
 
    display: none; 
 
} 
 
.forsidetags { 
 
    display: none; 
 
} 
 
.dropbtn { 
 
    line-height: 200%; 
 
} 
 
.hamburger { 
 
    background-color: black; 
 
    position: absolute; 
 
    top: 0; 
 
    right: 0; 
 
    line-height: 25px; 
 
    padding: 0px 15px 0px 15px; 
 
    color: #fff; 
 
    border: 0; 
 
    font-size: 1.4em; 
 
    font-weight: bold; 
 
    cursor: pointer; 
 
    outline: none; 
 
    border-radius: 0px; 
 
} 
 
.cross { 
 
    background-color: black; 
 
    position: absolute; 
 
    top: 0px; 
 
    right: 0; 
 
    padding: 0px 15px 0px 15px; 
 
    color: #fff; 
 
    border: 0; 
 
    font-size: 3em; 
 
    line-height: 65px; 
 
    font-weight: bold; 
 
    cursor: pointer; 
 
    outline: none; 
 
    border-radius: 0px; 
 
} 
 
.menu { 
 
    z-index: 1000000; 
 
    font-weight: bold; 
 
    font-size: 1.5em; 
 
    width: 100%; 
 
    background: #131313; 
 
    position: absolute; 
 
    text-align: center; 
 
} 
 
.menu ul { 
 
    margin: 0; 
 
    padding: 0; 
 
    list-style-type: none; 
 
    list-style-image: none; 
 
} 
 
.menu li { 
 
    display: block; 
 
    padding: 5px 0 5px 0; 
 
    border-bottom: #1d1f20 1px solid; 
 
} 
 
.menu li:hover { 
 
    display: block; 
 
    background: black; 
 
    padding: 15px 0 15px 0; 
 
    border-bottom: #1d1f20 1px solid; 
 
} 
 
.menu ul li a { 
 
    text-decoration: none; 
 
    margin: 0px; 
 
    color: #fff; 
 
} 
 
.menu ul li a:hover { 
 
    color: white; 
 
    text-decoration: none; 
 
} 
 
.menu a { 
 
    text-decoration: none; 
 
    color: white; 
 
} 
 
.menu a:hover { 
 
    text-decoration: none; 
 
    color: white; 
 
} 
 
.glyphicon-home { 
 
    color: black; 
 
    font-size: 1.5em; 
 
    margin-top: 5px; 
 
    margin: 0 auto; 
 
} 
 
.container { 
 
    width: 90%; 
 
    margin: 0 auto; 
 
} 
 
.slideshow { 
 
    margin-bottom: 10px; 
 
} 
 
.slideshow img { 
 
    height: auto; 
 
    width: 100%; 
 
    box-shadow: 1px 3px 3px #aaa; 
 
} 
 
.salepoint img { 
 
    width: auto; 
 
    height: 30px; 
 
} 
 
#tekst1 { 
 
    margin-bottom: 0; 
 
} 
 
#text11 { 
 
    margin-top: 0; 
 
} 
 
#tekst2 { 
 
    margin-bottom: 0; 
 
} 
 
#tekst22 { 
 
    margin-top: 5px; 
 
} 
 
.salepoint { 
 
    border: solid 2px; 
 
    padding: 5px; 
 
    margin: 20px; 
 
    text-align: center; 
 
} 
 
.artikel h2 { 
 
    line-height: 0.7; 
 
    margin-top: 15px; 
 
} 
 
footer { 
 
    background: black; 
 
    clear: both; 
 
    overflow: hidden; 
 
} 
 
.socialmedia { 
 
    margin-right: 10px; 
 
    float: right; 
 
} 
 
.socialmedia img { 
 
    width: 30px; 
 
    height: auto; 
 
    padding: 10px 0; 
 
    margin: 10px; 
 
    display: inline; 
 
} 
 
.socialmedia1 { 
 
    float: left; 
 
    margin-left: 10px; 
 
} 
 
.socialmedia1 img { 
 
    width: 30px; 
 
    height: auto; 
 
    padding: 10px 0; 
 
    margin: 10px; 
 
    float: left; 
 
} 
 
.show { 
 
    margin: 0 auto; 
 
    width: 90% 
 
} 
 
.show img { 
 
    height: auto; 
 
    width: 100%; 
 
    margin: 0 auto; 
 
} 
 
.show1 { 
 
    margin: 0 auto; 
 
    width: 40%; 
 
    margin-bottom: 25px; 
 
} 
 
.show1 img { 
 
    height: auto; 
 
    width: 100%; 
 
    margin: 0 auto; 
 
} 
 
/* Cecilie CSS */ 
 

 
.produkt.six.columns { 
 
    margin: 2px; 
 
    width: ; 
 
    margin: 0 auto; 
 
    float: none; 
 
    overflow: hidden; 
 
} 
 
.produkt-billede { 
 
    width: 50%; 
 
    margin: 5px; 
 
} 
 
.produkt-tekst { 
 
    max-height: 300px; 
 
    width: 37%; 
 
    margin: 5px; 
 
    float: right; 
 
} 
 
a:hover { 
 
    color: white; 
 
} 
 
@media (max-width: 665px) { 
 
    .opening { 
 
    display: none; 
 
    } 
 
} 
 
@media (min-width: 665px) { 
 
    .menu, 
 
    .hamburger, 
 
    .cross { 
 
    display: none; 
 
    } 
 
    .salepoint { 
 
    display: none; 
 
    } 
 
    .navi { 
 
    display: block; 
 
    background: black; 
 
    margin-bottom: 8px; 
 
    font-size: 1.5em; 
 
    z-index: 1000000; 
 
    } 
 
    .kurv { 
 
    height: 40px; 
 
    width: auto; 
 
    background: none; 
 
    float: right; 
 
    margin-right: 15px; 
 
    margin-top: 12px; 
 
    } 
 
    .logo2 { 
 
    height: 70px; 
 
    width: auto; 
 
    background: none; 
 
    float: left; 
 
    } 
 
    .logo { 
 
    display: none; 
 
    } 
 
    ul { 
 
    list-style-type: none; 
 
    margin: 0; 
 
    padding: 4px; 
 
    overflow: hidden; 
 
    } 
 
    li { 
 
    display: inline; 
 
    padding-right: 1.2rem; 
 
    } 
 
    li a, 
 
    .dropbtn { 
 
    display: inline-block; 
 
    color: white; 
 
    text-align: center; 
 
    padding: 14px 16px; 
 
    text-decoration: none; 
 
    } 
 
    li a:hover, 
 
    .dropdown:hover .dropbtn { 
 
    background-color: black; 
 
    color: white 
 
    } 
 
    a:hover { 
 
    color: white; 
 
    } 
 
    li.dropdown { 
 
    display: inline-block; 
 
    } 
 
    .dropdown-content { 
 
    display: none; 
 
    position: absolute; 
 
    background-color: lightgrey; 
 
    min-width: 110px; 
 
    z-index: 10000; 
 
    } 
 
    .dropdown-content a { 
 
    color: black; 
 
    padding: 12px 16px; 
 
    text-decoration: none; 
 
    display: block; 
 
    text-align: left; 
 
    } 
 
    .dropdown-content a:hover { 
 
    background-color: white 
 
    } 
 
    .dropdown:hover .dropdown-content { 
 
    display: block; 
 
    } 
 
    .slideshow { 
 
    max-width: 800px; 
 
    margin: 15px auto 15px auto; 
 
    } 
 
    .forsidetags { 
 
    display: block; 
 
    height: auto; 
 
    width: 900px; 
 
    margin: 0 auto; 
 
    } 
 
    /* Cecilie CSS */ 
 
    .produkt.six.columns { 
 
    width: 40%; 
 
    margin: 20px; 
 
    float: left; 
 
    } 
 
    .produkt-billede { 
 
    max-height: 300px; 
 
    width: 50%; 
 
    margin: 5px; 
 
    float: left; 
 
    } 
 
    .produkt-tekst { 
 
    max-height: 300px; 
 
    width: 35%; 
 
    margin: 5px; 
 
    float: left; 
 
    } 
 
    .produkt-oversigt { 
 
    display: flex; 
 
    flex-flow: row wrap; 
 
    justify-content: center; 
 
    } 
 
}
<!DOCTYPE HTML> 
 
<html lang="da"> 
 
<head> 
 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
 

 
    <link type="text/css" rel="stylesheet" href="css/normalize.css" /> 
 
    <link type="text/css" rel="stylesheet" href="css/skeleton.css" /> 
 
    <link type="text/css" rel="stylesheet" href="css/style.css" /> 
 
    <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"> 
 

 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> 
 

 
    <title>Herregård Møbler</title> 
 
</head> 
 
<body> 
 
    <header> 
 
    <button class="hamburger">&#9776;</button> 
 
    <button class="cross">&#735;</button> 
 
    </header> 
 
    <nav> 
 
    <div class="navi"> 
 
     <img class="logo2" src="img/logo2.png" alt="Herregård-logo"> 
 
     <img class="kurv" src="img/kurv.png" alt="kurv"> 
 
     <ul> 
 
     <li><a href="index.html">FORSIDE</a></li> 
 
     <li class="dropdown"> 
 
      <a href="#" class="dropbtn">PRODUKTER</a> 
 
      <div class="dropdown-content"> 
 
      <a href="stole.html">Stole</a> 
 
      <a href="#">Borde</a> 
 
      <a href="#">Sofaer</a> 
 
      <a href="#">Kommoder</a> 
 
      </div> 
 
     </li> 
 
     <li><a href="showroom.html">SHOWROOM</a></li> 
 
     <li class="dropdown"> 
 
      <a href="#" class="dropbtn">KONTAKT</a> 
 
      <div class="dropdown-content"> 
 
      <a href="#">Om os</a> 
 
      </div> 
 
     </li> 
 
     </ul> 
 
    </div> 
 
    <img class="logo" src="img/logo2.png" alt="Herregård-logo"> 
 
    <div class="menu"> 
 
     <ul> 
 
     <a href="index.html"> 
 
      <li>FORSIDE</li> 
 
     </a> 
 
     <li class="dropdown"> 
 
      <a href="#" class="dropbtn">PRODUKTER</a> 
 
      <div class="dropdown-content"> 
 
      <a href="stole.html">Stole -</a> 
 
      <a href="#">Border -</a> 
 
      <a href="#">Sofaer -</a> 
 
      <a href="#">Kommoder</a> 
 
      </div> 
 
     </li> 
 
     <li class="dropdown"> 
 
      <a href="showroom.html" class="dropbtn">Showroom</a> 
 
     </li> 
 
     <li class="dropdown"> 
 
      <a href="#" class="dropbtn">KONTAKT</a> 
 
      <div class="dropdown-content"> 
 
      <a href="#">Om os</a> 
 
      </div> 
 
     </li> 
 
     </ul> 
 
    </div> 
 
    </nav> 
 

 
    <article> 
 
    <div class="container"> 
 
     <div class="slideshow"> 
 
     <img class="mySlides" src="img/slide1.png" alt="slideshow1"> 
 
     <img class="mySlides" src="img/slide2.png" alt="slideshow2"> 
 
     <img class="mySlides" src="img/slide3.png" alt="slideshow3"> 
 
     <img class="mySlides" src="img/slide4.png" alt="slideshow4"> 
 
     </div> 
 
    </div> 
 

 
    <img class="forsidetags" src="img/forsidetags2.png" alt="forsidetag"> 
 

 
    <div class="salepoint"> 
 
     <img src="img/levering.png" alt="lastbil"> 
 
     <p>Hos Herregård Møbler tilbyder vi fri levering i hele Danmark for varer købt i vores webshop</p> 
 
    </div> 
 
    <div class="salepoint"> 
 
     <img src="img/kvalitet.png" alt="kvalitet"> 
 
     <p>Vi er dedikeret til altid at levere den bedst mulige kvalitet og den sikreste fragt.</p> 
 
    </div> 
 
    <div class="salepoint"> 
 
     <img src="img/garanti.png" alt="garanti"> 
 
     <p>Vi tilbyder op til 20 års udvidet garanti på vores møbler, hvis de registreres her.</p> 
 
    </div> 
 

 
    </article> 
 

 
    <footer> 
 
    <div class="socialmedia"> 
 
     <img src="img/facebook.png" alt="Facebook"> 
 
     <img src="img/instagram.png" alt="Instagram"> 
 
     <img src="img/linkedin.png" alt "LinkedIn"> 
 
    </div> 
 

 
    <div class="socialmedia1"> 
 
     <img src="img/visa.png" alt="Visa"> 
 
     <img src="img/mastercard.png" alt="Mastercard"> 
 
     <img src="img/maestro.png" alt "Maestro"> 
 
    </div> 
 
    </footer> 
 

 
    <script> 
 
    var slideIndex = 0; 
 
    carousel(); 
 

 
    function carousel() { 
 
     var i; 
 
     var x = document.getElementsByClassName("mySlides"); 
 
     for (i = 0; i < x.length; i++) { 
 
     x[i].style.display = "none"; 
 
     } 
 
     slideIndex++; 
 
     if (slideIndex > x.length) { 
 
     slideIndex = 1 
 
     } 
 
     x[slideIndex - 1].style.display = "block"; 
 
     setTimeout(carousel, 6000); 
 
    } 
 

 
    $(".cross").hide(); 
 
    $(".menu").hide(); 
 
    $(".hamburger").click(function() { 
 
     $(".menu").slideToggle("slow", function() { 
 
     $(".hamburger").hide(); 
 
     $(".cross").show(); 
 
     }); 
 
    }); 
 

 
    $(".cross").click(function() { 
 
     $(".menu").slideToggle("slow", function() { 
 
     $(".cross").hide(); 
 
     $(".hamburger").show(); 
 
     }); 
 
    }); 
 
    </script> 
 
</body> 
 
</html>

.

+1

코드 덤프를 완전히하지 마십시오. 최소한의 구체적이고 검증 가능한 예제로 문제를 줄이십시오. – Terry

+0

죄송합니다. 나는 다음에 그것을 기억할 것이다. 아직도 사이트에 새로운 :-) – Munksgaard

답변

0

당신은 click 이벤트를 듣고 있습니다. (일부) iDevices에서 작업하려면 tap 이벤트에 바인딩해야합니다.

$(".hamburger").on('tap', function() { 
    $(".menu").slideToggle("slow", function() { 
    $(".hamburger").hide(); 
    $(".cross").show(); 
    }); 
}); 

$(".cross").on('tap', function() { 
    $(".menu").slideToggle("slow", function() { 
    $(".cross").hide(); 
    $(".hamburger").show(); 
    }); 
}); 
+0

그래, 좋아. 저는 jQuery를 처음 접했습니다. 이것은 영원히 함께 모여서 선생님이 가르치는 교훈이 될 것입니다 ... – Munksgaard

+0

화재가 발생하는 이유에 대해 정말 이상한 의견을 가지고있는 Apple이기 때문에 많은 사람들이 고민하지 마십시오. 두 개의 다른 MacBook 모델에서 동일한 OSX/Safari 버전을 사용할 수 있으며 하나는 클릭하고 다른 하나는 탭을 제공합니다. –

+0

괜찮습니다. 어쨌든 고마워요. 감사합니다. 적어도 나는 왜 그런지 압니다. – Munksgaard

관련 문제