1

Here's my fiddle - http://jsfiddle.net/Jv9gc/

My problem at the moment is I haven't been able to get my custom right click menu to do anything, not even a simple alertbox. Can anyone help? What am I doing wrong?

1 Answer 1

1

Try this please: Working Demo http://jsfiddle.net/77L4w/

Hope this will fit the cause :)

code

$('#movecam').draggable({
    drag: function() {
        $('#mecam').css('top', $(this).position().top);
        $('#mecam').css('left', $(this).position().left);
    },
    stop: function() {
        $('#mecam').css('top', $(this).position().top);
        $('#mecam').css('left', $(this).position().left);
    }
});

$("#movecam").bind("contextmenu", function(event) {
    event.preventDefault();
    $("div.custom-menu").hide();
    $("<div class='custom-menu'><input id='propertz' type='button' name='propertz' value='Properties'></div>").appendTo("body").css({
        top: event.pageY + "px",
        left: event.pageX + "px"
    });

    init_prperty_click()
}).bind("click", function(event) {
    $("div.custom-menu").hide();
});

$('input[name="closeme"]').click(function() {
    $("#movecam").hide();
});

function init_prperty_click() {
    $("input[name=propertz]").on('click', function() {
        alert("haha");
    });
}​
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.