简体   繁体   English

带有bootstrap 3 glyphicons的jQuery contextmenu

[英]Jquery contextmenu with bootstrap 3 glyphicons

Have any one tried jQuery-contextMenu with Bootstrap icons? 有没有尝试过带有Bootstrap图标的jQuery-contextMenu

Sample JS code: 样本JS代码:

$(function(){
    $.contextMenu({
        selector: '.context-menu-one', 
        items: {
            "edit": {name: "Edit", icon: "glyphicon glyphicon-edit"},
            "cut": {name: "Cut", icon: "cut"},
            "copy": {name: "Copy", icon: "copy"},
            "paste": {name: "Paste", icon: "paste"},
            "delete": {name: "Delete", icon: "delete"},
            "sep1": "---------",
            "quit": {name: "Quit", icon: "quit"}
        }
    });
});

is there any other way to create multilevel contextMenu in bootstrap?? 还有其他方法可以在引导程序中创建多级contextMenu吗?

You can change the css in the jquery.contextMenu.css for the icon as specified in Use Font Awesome Icons in CSS 您可以在jquery.contextMenu.css中更改图标的css,如CSS中的“ 使用字体真棒图标”中所指定的

Here is an example 这是一个例子

Original 原版的

.context-menu-item.icon-edit {
  background-image: url(images/edit.png);
}

New

.context-menu-item.icon-edit {
    position: relative;
}
.context-menu-item.icon-edit:before {
    content:"\270f";
    font-family: "Glyphicons Halflings";
    left: 5px;
    position: absolute;
    top: 5;
}

Have a look at this link. 看一下这个链接。 This contextmenu is of type bootstrap so you will not get any problem while using it.Hope this Helps 此上下文菜单属于bootstrap类型,因此在使用时不会出现任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM