Skip to content

how can i change the css width of the contextMenu #710

Description

@wangpengabc
$(document).ready(function() {
        $.contextMenu({
            // define which elements trigger this menu
            selector: ".selecteColor",
            className: 'context-style',
            id: "contextmenu",
            callback: function(key, options) {
                //var m = "clicked: " + options.$trigger.attr('id');
                adiv_CubeFace = document.getElementById(options.$trigger.attr('id'));
                
                adiv_CubeFace.style.background = key;
                
                cube.getAndRefreshColor();
                
            },
            // define the elements of the menu
            items: {
                blue: {name: "11111111", className: 'blue_style', },
                yellow: {name: "22221111", className: 'yellow_style',},
                white: {name: "33331111", className: 'white_style',},
                green: {name: "44441111", className: 'green_style',},
                orange: {name: "55551111", className: 'orange_style',},
                red: {name: "66661111", className: 'red_style',},
            }
     
        });

        $('.context-style').css('width', '20px');
        
    });

I just want to change the width of the contextMenu through $('.context-style').css('width', '20px');.
But i find that it does not work. What should i do to achive that? thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions