Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Ajax
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Ajax the combination of XHTML, CSS, DOM, XML, XSLT, XMLHttpRequest, and JavaScript
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ajax section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 11th, 2007, 01:26 AM
Authorized User
 
Join Date: Sep 2007
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Right click to Open a menu

Hi,

I have a list (<li>) and need to display a menu when user [u]right </u>clicks on an item. is there any javascript function to do that?

<li onclick ="funct()"> item </li>

Thanks,
Reply With Quote
  #2 (permalink)  
Old October 12th, 2007, 07:28 AM
Registered User
 
Join Date: Oct 2007
Location: Chennai, Tamilnadu, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes we can,

  I hope below example helps you.Instead of onclick you have to use oncontextmenu.

  // e is the event which gecko engines required where el is the <li> tag
  function showMenu(e,el) {
     with(el) {
       position='absolute';
       style.cssText="font:...."; // your css for menu appearance.
       left= (window.event) ? event.clientX : e.clientX;
       top= (window.event) ? event.clientY : e.clientY;
       display = "block";
    }
     return false;// suspend the browser specific right click menu.
  }

 Just try this ..

Keep Smiling that doesn't cost you much...

Hari Kishore.
Reply With Quote
  #3 (permalink)  
Old November 5th, 2007, 02:25 AM
Authorized User
 
Join Date: Sep 2007
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a million!:)

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Before Right Click showpopup menu davespearce Excel VBA 0 December 11th, 2007 08:03 PM
right click on a menu item chuckcottle C++ Programming 3 May 14th, 2007 11:34 AM
Generate a menu when right click a cell Andraw Classic ASP Basics 4 March 24th, 2005 05:37 PM
right click menu hidden by drop-drown menu Andraw HTML Code Clinic 0 March 18th, 2005 03:28 PM



All times are GMT -4. The time now is 10:52 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.