Javascript 在jQuery菜单中插入一个div

Javascript 在jQuery菜单中插入一个div,javascript,jquery,html,jquery-plugins,Javascript,Jquery,Html,Jquery Plugins,我有一个jQuery菜单插件,看起来像这样 <script type="text/javascript"> jQuery(document).ready(function(){ jQuery('#promo').pieMenu({icon : [ { path : "/wp-content/themes/Tersus/i

我有一个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> 

jQuery(文档).ready(函数(){
jQuery(“#promo”).piemonu({图标:[
{ 
路径:“/wp content/themes/Tersus/images/piemon/winamp.png”,
alt:“Winamp”,
fn:function(){('Click::Plus');window.location.href='http://94.23.250.14:2199/tunein/tranceilfm.pls“;返回false}
},  { 
路径:“/wp content/themes/Tersus/images/piemun/vlc.png”,
alt:“VLC媒体播放器”,
fn:function(){('Click::Plus');window.location.href='http://94.23.250.14:2199/tunein/tranceilfm.pls“;返回false}
},{ 
路径:“/wp content/themes/Tersus/images/piemon/QuickTime.png”,
alt:“快速时间玩家”,
fn:function(){('Click::Plus');window.location.href='http://94.23.250.14:2199/tunein/tranceilfm.qtl“;返回false}
},{ 
路径:“/wp content/themes/Tersus/images/piemon/WMP.png”,
alt:“Windows Media Player”,
fn:function(){('Click::Plus');window.location.href='http://94.23.250.14:2199/tunein/tranceilfm.asx“;返回false}
},{ 
路径:“/wp content/themes/Tersus/images/piemon/popup.png”,
alt:“弹出窗口”,
fn:function(){('Click::Plus');window.location.href='http://www.tranceil.fm/wp-content/plugins/fullwidth-audio-player/popup.html“;返回false}
},{ 
路径:“/wp content/themes/Tersus/images/piemunu/iTunes.png”,
alt:“iTunes”,
fn:function(){alert('…קרוב');return false}
}],
beforeMenuOpen:函数(){
jQuery(“”).css(
{
“位置”:“固定”,
“背景色”:“000000”,
“不透明度”:0.6,
“宽度”:“100%”,
“高度”:“100%”,
“z索引”:999,
“顶部”:0,
“左”:0
}).附于(“主体”);
},
beforeMenuClose:函数(){
jQuery('#shadow').remove();
}
});
});
如何将div从标题插入其中一个图标?我想要一个图标来调用这个div(它是一个音频播放器按钮,可以打开一个带有播放器的弹出窗口)


你可以检查并按下中间的“播放”按钮来检查。


有什么想法吗?

根据您的
数据元属性的功能,您可以将其添加到菜单中:

,{ 
  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,即
元素)

。您的“国王!”)给元素一个id就成功了!谢谢你(哇……不到10分钟……为我们创造记录;)
,{ 
  path : "/wp-content/uploads/2012/05/logo-tranceil-1024x5761.png",
  alt  : "Play",
  fn   : function(){$("#yourID").click();return false}