• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    Xarno Clipboard (gallery-xarno-clipboard) on cdn

    Last Updated: 03/30/11
    + 0 -

    Anthony Pipkin

    YUI Developer

    See 28 more by this user.

    Created: 02/3/11
    Last CDN Push: 03/30/11
    Build Tag: gallery-2011.03.30-19-47
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.3.0
    Free for use.

    Instantiate in your body and give it a series of selectors used to activate. A click event will copy the requested text to the clipboard. Also gives the ability for a single target to copy from.

    Download SWF


    Due to restrictions, you will need to host your own instance of the Xarno Clipboard SWF. You can get the latest copy here http://www.assembla.com/code/yui/git/nodes/yui3-gallery/sandbox/apipkin/gallery-xarno-clipboard?rev=master

    Methods


    • moveTo(target) - Moves the clipboard to the target and resizes to the width and height. This should be used to place the swf underneath the mouse so when clicked, it will trigger the click event of the SWF Clipboard
    • copy(target) - Sets the text to copy to the innerHTML of the target. Uses config `clipTarget` if target param is undefined or is null
    • moveToAndCopy(target) - Convenient method that moves to the target and sets the copy value to the innerHTML of said target
    • setText(text) - Sets the text value of the SWF Clipboard. This is the text that will be added to the clipboard when the SWF Clipboard is clicked.
    • hide() - Moves the clipboard off the screen

    Configuration


    • swfPath - (XarnoClipboard.swf) Path to swf file relative from document using the clipboard or absolute.
    • clipTarget - Item to copy contents of
    • hand - (true) Show a hand cursor when clipboard is moused over
    • debug - (false) Gives the clipboard a background color
    • Tags:
    • apipkin
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    This example uses a single clipboard instance to move about the page when you mouse over a clipTarget.

    When the clipboard is clicked on, the clipTarget's contents are copied and you can paste them in the textarea provided.

    Notice, we use mouseover to move the clipboard under our cursor and above our target element. This makes it so when we click to copy, we are actually clicking on the SWF.

    Code Sample

    <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
    <div class="xarno-clipboard-copy">Click me <strong>to</strong> copy: A</div>
     
    <div class="xarno-clipboard-copy">Click me to copy: B</div>
    <textarea>

    Forum Posts

    No forum posts for this module.

    © 2006-2013 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info