2

ホバー ロールオーバーの href リンクの ipad/iphone でのタッチに問題がありました。

iPadの最初のタッチでボックスを画像に合わせてから、もう一度タッチしてユーザーを別のページに送信できるようにしたいと思います。現在、リンクは表示されません。そして、私は何をすべきかを知るのに苦労しています。

HTML:

<!-- IMAGE CONTAINER -->
<div class="image-container">
   <div class="image-container-overflow">
      <div class="image-container-actual">
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
         <div class="image">
            <img src="http://www.placehold.it/188x188" />
            <div class="hoverimg">
               <a href="success.html">
                  <img class="fade" src="_includes/img/global/image2.jpg" width="188" height="188" />
                  <p>Helen was offered a job as a florist two weeks after she completed her Pinewood training. <br><br><strong>See Success Stories</strong></p>
               </a>
            </div>
         </div>
      </div>
   </div>
</div>
<!-- IMAGE CONTAINER -->

CSS:-

/* Editable Multiple Image Area */
.image-container {
    width: 100%;
    margin: 0;
    padding: 0;
    height: 360px;
    overflow: hidden;
}

.internal .image-container {
    width: 100%;
    margin: 0;
    padding: 0;
    height: 180px;
    overflow: hidden;
}

.contact .image-container {
    width: 100%;
    margin: 0;
    padding: 0;
    height: 180px;
    overflow: hidden;
}

.image-container-overflow {
    width: 100%;
    padding-right: 187px;
    height: 360px;
    position: relative;
}

.image-container-actual {
    width: 100%;
    height: 360px;
    position: absolute;
    top: 0;
    left: 0;
}

.image {
    position: relative;
    float: left;
    width: 188px;
    height: 188px;
    margin: 0;
    padding: 0;
}

.image img {
    position: absolute;
    z-index: 1;
    left: 0;
    top: 0;
}

.image:hover div {
    display: block!important;
}

.image img:hover div {
    display: none;
    position: absolute;
    z-index: 2;
    width: 100%;
    height: 100%;
    background: #f28f0a;
}

.hoverimg {
    display: none;
    position: absolute;
    z-index: 2;
    width: 100%;
    height: 100%;
    background: #f28f0a;
}

.hoverimg p {
    font-family: 'ralewayregular';
    color: #fff;
    position: absolute;
    z-index: 3;
    font-weight: normal;
    margin: 30px;
    font-size: 12px;
    letter-spacing: .5px;
    line-height: 18px;
}

.fade {
    opacity: 1;
    transition: opacity .25s ease-in-out;
    -moz-transition: opacity .25s ease-in-out;
    -webkit-transition: opacity .25s ease-in-out;
}

.fade:hover {
    opacity: 0.2;
}

ここにフィドルがあります: - http://jsfiddle.net/m67k8/

誰かがアイデアを持っているなら、私はどんな助けにも感謝します。

4

1 に答える 1

0

そのために JavaScript/JQuery を使用します。クリックされた(タッチされた)リンクは、ホバーコンテンツが表示されているかどうかにかかわらず異なる動作をする必要があるため、.hoverimg がオンのときにクラスを追加し、制御する条件を指定して関数を記述するのが最も簡単で簡単な方法だと思います。このようなリンクの動作:

$('.hoverimg a').click(function(e) {
    if ( !$(this).parent('.hoverimg').hasClass('on') ) {
        e.preventDefault();
        $(this).parent('.hoverimg').addClass('on').css('display', 'block');
    }
});

これがフィドルです:http://jsfiddle.net/m67k8/1/

于 2013-11-05T15:20:29.017 に答える