我有一个用这些参数表示的 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(){$("#popupplay").click();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>
该菜单通过右键单击进行操作。我需要将其更改为悬停。
该插件的作者给出了插入内容的片段:
$(document).ready(function(){
//init my jPie
var jPieMenu = $(#myelement').pieMenu({icon : [ {
path : "path/to/images.png",
alt : "icon",
fn : function(){alert('Click:: icon');return false;}
}] });
$('#myelement').hover(function(){
if($('#'+jPieMenu.id).css('display') != 'block') //if jpie is not visible
jPieMenu.initMenu(200,200);
})
})
唯一的问题是我不知道在哪里插入什么......我总是得到意想不到的令牌。有人可以查看我上面的代码并建议插入它的位置吗?
提前谢谢。