Javascript context menu, supporting different objects and different menus (compatible with IE and Firefox) _ javascript skills

Source: Internet
Author: User
Although the version is very old and does not conform to the standard, the code is worth reference. If you need a right-click menu, you can refer to it. Although the version is very old and does not conform to the standard, the code is worth reference. If you need a right-click menu, you can refer to it.

The code modification is also relatively simple.

  Ddd    
 Script/*** DreamCore-JsLib/Menu Date: Dec 03,200 6 Copyright: DreamSoft Co ., ltd. mail: Dream@Dreamsoft.Ca Author: Egmax Browser: IE5.0 & +, Firefox1.5 & +, Netscape7.0 & + Update: ***/if (! Document. all) document. captureEvents (Event. MOUSEDOWN); var _ Tmenu = 0; var _ Amenu = 0; var _ Type = 'a'; document. onclick = _ Hidden; function _ Hidden () {if (_ Tmenu = 0) return; document. getElementById (_ Tmenu ). style. visibility = 'den den '; _ Tmenu = 0;} document. oncontextmenu = function (e) {_ Hidden (); var _ Obj = document. all? Event. srcElement: e.tar get; if (_ Type. indexOf (_ Obj. tagName) =-1) return; _ Amenu = _ Obj. getAttribute ('menu '); if (_ Amenu = 'null') return; if (document. all) e = event; _ ShowMenu (_ Amenu, e); return false;} function _ ShowMenu (Eid, event) {var _ Menu = document. getElementById (Eid); var _ Left = event. clientX + document. body. scrollLeft; var _ Top = event. clientY + document. body. scrollTop; _ Menu. style. left = _ Left. toString () + 'px '; _ Menu. style. top = _ Top. toString () + 'px '; _ Menu. style. visibility = 'visable'; _ Tmenu = Eid;}/*** supports other tag INPUT, IMG ***/script _ Type = 'input, a, DIV, BODY, IMG '; script
  

Script house Baidu google webmaster Tool

    Print

    Haha, I am a link. Please check it out.

      Print

      Haha, although I cannot open images

        Print

        Menu 1 menu 2

        Contact Us

        The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

        If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

        A Free Trial That Lets You Build Big!

        Start building with 50+ products and up to 12 months usage for Elastic Compute Service

        • Sales Support

          1 on 1 presale consultation

        • After-Sales Support

          24/7 Technical Support 6 Free Tickets per Quarter Faster Response

        • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.