I am using jquery context menu plugin https://github.com/joewalnes/jquery-simple-context-menu/blob/master/README.md
Now I have two option on menu 1. send message 2. view profile
When user click on 1. send message I want to open popup window in the center of the screen.
When user click on 2. View profile it should be send to them url (e.g. linkurl to profile)
I have never used context menu and I am using in php with passing user id dynamically. I got everything is works now but only don’t know how to open popup window and send to url.
Here is javascript
$(function() {
$("#mythingy").contextPopup({
title: "My Popup Menu",
items: [{
label: "Send message",
icon: "icons/message.png",
action: function() {
// how to open popup window with form
}
},
{
label: "View profile",
icon: "icons/zoom.png",
action: function() {
// how to add url here
}
}]
});
});
Navigating to another page is easy – just assign to
location.href.jQuery doesn’t provide an alternative for this, but if you really want to use jQuery, you can do this:
For popups, you can use the Fancybox plugin for jQuery.
to open:
If you want to open a separate browser window instead of opening a popup inside the page, you can use
window.open():