Grow your CSS skills. Land your dream job.

Context Menu Links

  • # March 11, 2010 at 4:56 pm

    I am creating my own contextual menu for trial purposes.

    Here is my code:

    Code:
    jQuery(document).ready(function($){
    $(‘html’).addcontextmenu(‘contextmenu’)
    });

    function ViewSource() {
    window.open(“view-source:” + window.location, ”, ‘status=0,toolbar=0,menubar=1,location=0′) }

    function newTab() {
    window.open(window.location, ”, ”);
    }

    [code
    <li><a href="javascript:history.go(-1)">Back</a></li>
    <li><a href="javascript:history.go(1)">Foward</a></li>
    <li><a href="javascript:window.stop()">Stop</a>
    <li class="section-bottom"><a href="javascript:window.location.reload(false)">Reload</a></li>
    <li class="section-middle"></li>
    <li class="section-top"><a href="javascript:window.print()">Print</a></li>
    <li><a href="javascript:ViewSource()">View Source</a></li>
    <li><a href="javascript:newTab()">Open Page In New Tab</a></li>
    [/code]

    But I am looking to create buttons like Save (CTRL+S), Select All (CTRL+A), Copy (CTRL+C), Cut (CTRL+X), Paste (CTRL+P) and Bookmark (CTRL+D).

    Can be jQuery or javascript, but not to many lines.

    Copying I have looked into zeroClipboard, and toying around, but I if could gain a function using ctrl+letter that would be better.

    A demo would be right clicking, that’s the context menu.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".