2013-10-10 81 views
0

我有一個簡單的切換事件,並且桌面上的一切工作正常,但是當我去電話時,我必須點擊兩次才能讓它切換到打開狀態?切換打開關閉必須在電話上點擊兩次

以下是我有:

$(".service-m").click(function() { 
    $(this).next(".serviceinfo-m").toggle() 
}); 

<a class="service-m">   
Some Text 
</a> 

<div class="serviceinfo-m" style="display:none;">The First Line of Text.</div> 
<a class="service-m">   
    Some Text 
</a> 

<div class="serviceinfo-m" style="display:none;">The First Line of Text.</div> 
<a class="service-m">   
    Some Text 
</a> 

<div class="serviceinfo-m" style="display:none;">The Second Line of Text.</div> 
<a class="service-m">   
    Some Text 
</a> 

<div class="serviceinfo-m" style="display:none;">The Third Line of Text.</div> 

另外這裏是的jsfiddle http://jsfiddle.net/BrentRansom/tfM6E/1/

感謝

+0

我不知道你在說什麼關於,我只是導航到你用我的Galaxy-S4使用鉻瀏覽器撥弄,它工作正常。 –

+0

在我的iphone上它現在可以工作。不知道爲什麼。 – user2751645

+0

現在還是沒有? – musicnothing

回答

0

我去了,雖然我的CSS,發現我在我的CSS衝突的鏈接。 以下是我有我使用較少:

.service-m { 
     margin:0; 
     padding:5px 10px; 
     position: relative; 
     height:70px; 
     display: block; 
     font-family: @m; 
     font-size: 18px; 
     color: @light-gray; 
     border-top:2px dotted @light-gray; 
     .ico-nonhover { 
      visibility: visible; 
      position: absolute; 

      top:10px; 
      left:10px; 
      width:60px; 
     } 
     .ico-hover { 
      visibility: hidden; 
     } 
     h2 { 
      float:left; 
      position: relative; 
      top:26px; 
      left:70px; 
      margin:0; 
      padding:0; 
     } 
    } 
    .service-m:hover { 

     .ico-nonhover { 
      visibility: hidden; 
     } 
     .ico-hover { 
      visibility: visible; 
      position: absolute; 

      top:10px; 
      left:10px; 
      width:60px; 
     } 
     h2 { 
      float:left; 
      position: relative; 
      top:26px; 
      left:70px; 
      margin:0; 
      padding:0; 
     } 
    } 

這裏是固定的,我用的少:

.service-m { 
     margin:0; 
     padding:5px 10px; 
     position: relative; 
     height:70px; 
     display: block; 
     font-family: @m; 
     font-size: 18px; 
     color: @light-gray; 
     border-top:2px dotted @light-gray; 
     .ico-nonhover { 
      position: absolute; 
      top:10px; 
      left:10px; 
      width:60px; 
      z-index:1; 
     } 
     .ico-hover { 
      z-index: 0; 
      position: absolute; 
      top:10px; 
      left:10px; 
      width:60px; 
     } 
     h2 { 
      float:left; 
      position: relative; 
      top:26px; 
      left:70px; 
      margin:0; 
      padding:0; 
     } 
    } 
    .service-m:hover { 

     .ico-nonhover { 
      z-index:0; 
      position: absolute; 
      top:10px; 
      left:10px; 
      width:60px; 
     } 
     .ico-hover { 
      z-index:1; 
      position: absolute; 
      top:10px; 
      left:10px; 
      width:60px; 
     } 
     h2 { 
      float:left; 
      position: relative; 
      top:26px; 
      left:70px; 
      margin:0; 
      padding:0; 
     } 
    } 

感謝您的幫助,

相關問題