2012-08-01 67 views
0

我有一個jQuery菜單插件,看起來像這樣插入div jQuery的菜單

<script type="text/javascript"> 
      jQuery(document).ready(function(){ 


       jQuery('#promo').pieMenu({icon : [ 
         { 
          path : "/wp-content/themes/Tersus/images/piemenu/winamp.png", 
          alt : "Winamp", 
          fn : function(){('Click:: Plus');window.location.href = 'http://94.23.250.14:2199/tunein/tranceilfm.pls';return false} 
         }, { 
          path : "/wp-content/themes/Tersus/images/piemenu/vlc.png", 
          alt : "VLC Media Player", 
          fn : function(){('Click:: Plus');window.location.href = 'http://94.23.250.14:2199/tunein/tranceilfm.pls';return false} 
         },{ 
          path : "/wp-content/themes/Tersus/images/piemenu/QuickTime.png", 
          alt : "Quick Time Player", 
          fn : function(){('Click:: Plus');window.location.href = 'http://94.23.250.14:2199/tunein/tranceilfm.qtl';return false} 
         },{ 
          path : "/wp-content/themes/Tersus/images/piemenu/WMP.png", 
          alt : "Windows Media Player", 
          fn : function(){('Click:: Plus');window.location.href = 'http://94.23.250.14:2199/tunein/tranceilfm.asx';return false} 
         },{ 
          path : "/wp-content/themes/Tersus/images/piemenu/popup.png", 
          alt : "נגן Popup", 
          fn : function(){('Click:: Plus');window.location.href = 'http://www.tranceil.fm/wp-content/plugins/fullwidth-audio-player/popup.html';return false} 
         },{ 
          path : "/wp-content/themes/Tersus/images/piemenu/iTunes.png", 
          alt : "iTunes", 
          fn : function(){alert('...בקרוב');return false} 
         }], 
        beforeMenuOpen: function(){ 
         jQuery('<div id="shadow"></div>').css(
         { 
          'position':'fixed', 
          'background-color':'#000000', 
          'opacity': 0.6, 
          'width':'100%', 
          'height':'100%', 
          'z-index' :999, 
          'top':0, 
          'left':0 
         }).appendTo('body'); 
        }, 
        beforeMenuClose: function(){ 
         jQuery('#shadow').remove(); 
        } 
       }); 
      }); 

     </script> 

如何插入從我的頭一個div來的一個圖標?我想其中一個圖標調用(與玩家打開一個彈出窗口,它的音頻播放器按鈕)DIV

<div class="fap-track-buttons"><a href="http://94.23.250.14:8000/live" title="TranceIL.FM" rel="http://www.tranceil.fm/wp-content/uploads/2012/05/logo-tranceil-1024x5761.png" target="" data-meta="#fap-meta-3227" class="fap-play-button fap-single-track">Play</a> 
       </div> 

您可以檢查http://www.tranceil.fm/和並按中間檢查它的「播放」按鈕出。

有什麼想法?

回答

1

根據您的data-meta元屬性做了什麼,你也許能增加這菜單閃避:

,{ 
    path : "/wp-content/uploads/2012/05/logo-tranceil-1024x5761.png", 
    alt : "Play", 
    fn : function(){window.location.href = 'http://94.23.250.14:8000/live';return false} 

如果沒有,你肯定可以做到這一點:

,{ 
    path : "/wp-content/uploads/2012/05/logo-tranceil-1024x5761.png", 
    alt : "Play", 
    fn : function(){$("#yourID").click();return false} 

然後你只需要添加id= "yourID"到播放按鈕(不是div,<a>元素)

+0

再次......你的國王! :)給一個ID爲元素做到了!謝謝youuuuuuu(和哇..10分鐘..記錄我們;) – Trance84 2012-08-02 10:22:45