How do I utilise 'snippets' of code that I've found on jsfiddle

Hi folks,
I've found a bit of code on jsfiddle that I would like to use within my EDGE document.
The fiddle in question is here
http://jsfiddle.net/NJwER/26/
I created an object on the stage and called it 'draggable' (as per the <div> naming in the jsfiddle example
I then copied this following piece of code from the jsfiddle 'JavaScript' pane into the 'CompositionReady' code panel of my EDGE document
$(function() {
    $("#draggable").draggable({
        helper: function(){
            // Create an invisible div as the helper. It will move and
            // follow the cursor as usual.
            return $('<div></div>').css('opacity',0);
        drag: function(event, ui){
            // During dragging, animate the original object to
            // follow the invisible helper with custom easing.
            var p = ui.helper.position();
            $(this).stop().animate({
                top: p.top,
                left: p.left
            },1000,'easeOutCirc');
But nothing happens at all. Can anybody let me know why this isn't working please?
Thanks,
Tom

Cheers Tim,
In the spirit of sharing I've managed to tweak another cool drag and drop from a jsfiddle to get a nice custom 'revert' animation.
All credit goes to whoever put the code up on jsfiddle and TimJaramillo for showing me how to apply that to EDGE.
Here's the source file https://www.dropbox.com/s/olwmgxwb7m0244y/DRAG_REVERT.zip
And here's the code for on Stage.compositionReady:
yepnope(
    nope:[
        'js/jquery-ui-1.9.2.custom.min.js',
        'js/jquery.ui.touch-punch.min.js',
        'css/jquery-ui-1.9.2.custom.min.css'
    complete: init
//function init() {
//    sym.$('draggable').draggable({
//        helper: function(){
            // Create an invisible div as the helper. It will move and
            // follow the cursor as usual.
//            return $('<div></div>').css('opacity',0);
//        drag: function(event, ui){
            // During dragging, animate the original object to
            // follow the invisible helper with custom easing.
//            var p = ui.helper.position();
//            $(this).stop().animate({
//                top: p.top,
//                left: p.left
//            },1000,'easeOutCirc');
function init() {
   sym.$('draggable').draggable({
    // We Can't use revert, as we animate the original object so
    //revert: true,  <- don't use this
    helper: function(){
        // Create an invisible div as the helper. It will move and
        // follow the cursor as usual.
        return $('<div></div>').css('opacity',0);
    create: function(){
        // When the draggable is created, save its starting
        // position into a data attribute, so we know where we
        // need to revert to.
        // cache $this to keep from having to make
        // lots of DOM calls w jquery
        var $this = $(this);
        $this.data('starttop',$this.position().top)
             .data('startleft',$this.position().left);
    stop: function(){
        // When dragging stops, revert the draggable to its
        // original starting position.
        var $this = $(this);
        $this.stop().animate({
            top: $this.data('starttop'),
            left:$this.data('startleft')
        },1000,'easeOutElastic');
        // replace with whatever jQueryUI easing you want
    drag: function(event, ui){
        // During dragging, animate the original object to
        // follow the invisible helper with custom easing.
        $(this).stop().animate({
            top: ui.helper.position().top,
            left: ui.helper.position().left
        },0,'linear');

Similar Messages

  • How can we identify the coupon code that triggered the promotion discount in the order?

    Hi,
    As we can create the coupons and assign the promotions to them to give discounts.How can we identity the coupon code that is added the promotion which caused the discount in the order?
    Regards,
    Chede

    I'm giving you an example. Here is how you do it starting with order level promotions. OrderImpl object API below give you orderpirceinfo and second link gives adjustments.
    http://docs.oracle.com/cd/E35319_01/Platform.10-2/apidoc/atg/commerce/order/OrderImpl.html#getPriceInfo()
    From OrderPriceInfo which extends AmountInfo, the following method gives adjustments
    http://docs.oracle.com/cd/E35319_01/Platform.10-2/apidoc/atg/commerce/pricing/AmountInfo.html#getAdjustments()
    Now iterate through adjustments, to get pricingmodel(which is promotion) and coupon applied on order
    PricingAdjustment (ATG Java API)
    PricingAdjustment (ATG Java API)
    Hope this gives you an idea where to start with.
    -karthik

  • I recently bought Photoshop Elements 12 and the system is saying that the Redemption Code is no longer active.  How do I get a new code that will allow access to the software ?

    I recently bought Photoshop Elements 12 and the system is telling me that the Redemption Code is no longer active.
    How do I get a new Code number that will allow met to access the software?

    you need your serial number.  you used your redemption number to redeem your serial number.
    if you don't know your serial number, check the account used to purchase or register your pse 12, Adobe ID

  • HT201210 how do i recover my pass code that i forgot?

    i need to get on my ipad but i forgot the passcode and i tryed to updade back up but i have to put in the pass code. how do i recover it or access my ipad without lossing my photos, notes, ect??? help me please.

    Your only option is to restore the iPad. Follow the instructions in the following:
    http://support.apple.com/kb/HT1808
    There is no way to recover the passcode. It is very secure.
    You will lose whatever was not backed up as of its last synchronization. Anything that you downloaded from Apple can be downloaded again.

  • How to recover withholding tax information code that was deleted ....

    Dear Sirs,
    one person of our client have deleted witholding tax code information in their 2007 financial documents. As result of this error they are not able to generate legal witholding tax report that should be delivered to nationatal state authority until 29th of February.
    There is any report/program that we can run in order to modify the documents (and introduce the withholding tax code) or to generate this witholding tax report?
    Many thanks for your collaboration.
    Ricardo Ferrão.

    Dear,
    W Tax Creation r Delete is related to Configuration mater. where this delection happend plz. tell me is it in master data r configuration) if is configuration you con't re creat those items. after delete the data also you can get the details in J1INMIS. please check.
    regards
    radha

  • How do i undo a lock code that was put on my ipod

    i have a ipod touch and my older brother borrowed it from me and when i got it back from him he had gone a put a password on it so i cant get into it, and i did ask him but he wont tell me at all so now a cant use my ipod!! HELP i go crazy without my music

    Connect the iOS device to your computer and restore via iTunes. Place the iPod in Recovery Mode if necessary to allow the restore.
    If recovery mode does not work try DFU mode.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    For how to restore:
    iTunes: Backing up, updating, and restoring iOS software
    To restore from backup see:
    iOS: How to back up
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the iPod backup that iTunes makes.
    You can redownload iTuns purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • How do I redeem an iTunes code that does not have a box around it?

    iI bought an iTunes gift and they received the email but it does not have a box around the code and they can't find a way to redeem it.

    Howdy Roy,
    It sounds to me like you have purchased an iTunes Gift Card and you’re having an issue redeeming it. I have linked to an article that may help in this situation:
    If you can't redeem your iTunes Gift Card or code - Apple Support
    Contact iTunes Store Support
    If the code is completely scratched off or you still can't redeem your gift card, contact iTunes Support:
    Go to the iTunes Store support page and choose your country.
    From the menu on the left, choose Contact Support.
    Click Contact iTunes Store Support.
    Follow the instructions.
    iTunes Store Support might ask you to send these things:
    Image of the full front and back of your gift card
    Sales receipt showing when your card was purchased
    Serial number from your gift card
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • How do I change the zip code that keeps showing up on my iPad,computer etc

    I live in the 60018 zip code but everytime i search for something it shows a zip code of 60068 how to I find the place to change this? this happen on the phone and the ipad and my mac  Help It make me nuts

    Welcome to the Apple Support Communities
    If you don't want to see your son's messages, first open the Messages app (you can find it on Dock). Then, after opening it, go to the Messages menu (on the menu bar) > Preferences > Accounts, and select the "iMessage" account. Finally, under "Send & Receive", you will see different phone numbers and mail addresses, so untick your son's phone number, and you won't receive more messages from him

  • How do I delete an email address that cannot be found in my contacts app

    An unknown email address always pops up when I try to select a recipient 
    That email address cannot be found anywhere in the contacts app when I try to get it deleted.
    It is an invalid address, as when I sent out a testing email, it was bounced as delivery failed.
    Is there a way to delete it ?
    Thank you.

    No there is no way to delete it. The addresses that the mail app "remembers" have nothing to do with what is in the Contacts App. If you mistakenly typed an incorrect email address at one time in the mail app - it is going to continue to come up as a suggestion from now on. There is no way to remove those short of restoring the iPad as a new device.

  • How do I configure an IP Printer that requires a user code?

    Hi, I am using my Macs in a shared office environment where we have a Ricoh printer accessible via an IP address. The instructions for configuring the printer are written for Windows Vista and Windows XP users (sigh). I am able to add the printer by typing in its IP address, and I get a list of some printer options. But apparently this printer requires clients to log in with a user code before starting a print job and therefore my print commands from my Mac don't get processed. How do I do this from Leopard?
    Thanks in advance for your help.

    DXB Law wrote:
    Yes, I am aware that it is my own IT management that requires the user code, not the printer,
    I only mentioned it because there are many people that think it is all "the printer's fault" that they need a user code.
    and my IT management has given me step-by-step instructions for how to configure Windows Vista to transmit that user code to the printer. But it seems that you are saying there is no configuration option in Leopard that allows for the transmission of a user code to a network printer?
    I don't know enough about Windows to comment on the different way things are handled. In the case of the Ricoh printers, the user code is submitted with the print job. PCL printers include PJL data along with the job. For PostScript printers, Ricoh does supply drivers with printer extensions that allow for the user to input their user code via the normal user interface.
    For non-PostScript network printers, Ricoh uses either a PCL 5 variant or PCL 6/PCL XL. There are several generic drivers for these printer languages, so users on most, if not all, other operating systems can print to the Ricoh printers. Further, Ricoh actually provides the PPDs for their printers that include all the extra functions (user codes, stapling, etc) that are available for a particular model. These PPDs get included in the OpenPrinting foomatic database. That way users of any system that can utilize the foomatic scheme will be able to print to Ricoh printers. This is not limited to Mac OS X. Foomatic supports CUPS, LPRng, LPD, GNUlpr, Solaris LP, PPR, PDQ, and CPS. It would be nearly impossible to write a specific graphical user interface for all the variants of Unix and Linux. That is why you must resort to editing a PPD file by hand.
    You may be able to eventually help other Mac OS X users by letting Ricoh tech support politely know that it would be *most helpful* to have an easy to use user interface to input your user code. With there being more and more Mac OS X users, I hope they will do something to keep their customers happy.
    Just remember, there are some manufacturers that still use proprietary printer languages for network printers. If they don't support your system, tough luck.
    Matt

  • HT5622 I updated new software on my phone and now can't use it because its asking for a 4 digit security code that I don't know. How do I find this number?

    I updated new software on my Apple 4S phone and now can't use it because it requires a 4 digit security code that I don't know. The phone store when I originally bought phone bypassed it for me. How do I find it?

    Hey dentallady!
    Here is an article that can help you reset this code:
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • How can I see all the Transaction Code that the client is using?

    How can I see all the List of Transaction Code that the client is using?

    Hello Sugauli,
    Did you mean to ask
    transaction types the client is using?
    instead of
    transaction code
    If so, go to SPRO (in ERP system) and follow this path:
    Sales and Distribution -->
         Sales -->
             Sales Documents -->
                 Sales Document Header -->
                      Define Sales Document Types
    All the transaction types that are not used have an X in the column Block.
    Easwar Ram
    http://www.parxlns.com

  • How can I write a code that triggers when clicking on Save button

    I want to hide certain fields inside my tracking list, if the login user is not part of the “Managers” group.
    To do so I want to add the following Page-load code inside a web part :-
    using (SPSite site = new SPSite(SPContext.Current.Site.Url))
    using (SPWeb web = site.OpenWeb())
    {SPGroup group = site.Groups["Managers"];
    bool isUser = site.IsCurrentUserMemberOfGroup(group.ID);
    if (isUser)
    {textbox.Visible=false;}}
    And the following custom code that triggers when saving the form :-
    using (SPSite site = new SPSite(SPContext.Current.Site.Url))
    using (SPWeb web = site.OpenWeb())
    SPList list = web.Lists["ListName"];web.AllowUnsafeUpdates = true;
    SPListItem item = list.Items[SPContext.Current.ListItem.UniqueId];
    txtTitle.Text = item["Title"] as string;item.Update();web.AllowUnsafeUpdates = false;
    But I am not sure where exactly I should add the custom code for the save button ? I tried writing it inside the Oninit method , but I got many errors as shown below:-
    So can anyone advice how i should write the web part to include the Page load & the custom save button code?
    second question in general is my above approach considered valid , i mean to hide/show list columns using web parts ?

    Hi,
    According to your post, my understanding is that you want to hide/show list columns based on specify the permission for Users, SharePoint Groups or Active Directory Groups.
    Here is a solution from CodePlex for your reference:
    SharePoint 2013 Column & View Permission
    https://sp2013columnpermission.codeplex.com/
    Best Regards
    Dennis Guo
    TechNet Community Support

  • My iPad with this security code and forgot it,how can I get him ?  Is that 4 digit code

    my iPad with this security code and forgot it,how can I get him ?  Is that 4 digit code.

    Recovery Mode
    1. Disconnect the USB cable from the device, but leave the other end of the cable connected to your computer's USB port.
    2. Turn off the device: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to turn off.
    3.While pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on.
    4. Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears, release the Home button. iTunes should alert you that it has detected a device in recovery mode. Click OK, and then click Restore to restore the device.
    Note: Data will be lost. You may have to repeat the above many times.

  • TS1292 how to activat a itunes code that will not redem

    how to activat a itunes code that will not redem

    I was having the same problem with a card that I received as a gift. Finally, I realized that it's an APPLE gift card and not an iTunes gift card. They are different and one will not work for another. The Apple card is used for hardware, software, cases, headphones, etc that you can buy in store or online. The iTunes card can only be used for music, apps, videos purchased through iTunes.
    But as long as it is in fact an iTunes card, the only other thing I've read about it not activating is to wait a few days and try it again. Sometimes it takes a while for the store where it was purchased from to send the activation info to Apple and read it as a valid code. I guess it doesn't happen instantaneously when scanned at the store.

Maybe you are looking for

  • Error in opening PDF generated through HAP_DOCUMENT(ESS/MSS)

    Hi Experts, User is getting an error while opening the PDF generated through "Print" functionality of appraisal document(HAP_Document). There is a problem i'am facing in this BSP's,when i click on PRINT after creating Appraisal,it will ask me to eith

  • Ask Print Layout Designer for customize report

    Dear all I am newbie in SAP, and i must create report with PLD  like : PAYMENT TYPE          AMOUNT By CASH Cash               1000 Cash               2000 Cash               3000 Cash               4000 Total Cash          10000 By CREDIT Credit    

  • Creating a Configuration Scenario from Process Component Interaction Model

    Dear All, I created a very simple SAP Pro Comp Interaction Model in ESR. It has two Process Components (PC1, PC2) with a Service Interface (SI1,SI2) and Operation (OP1,OP2) each. There is one message (MT1) flowing between these two Process Components

  • My desktop Manager font's was turned "boxes"

    hallo guys.....anyone can help me? my desktop Manager font's was turned "boxes" I have remove it and reinstall, but its not working....and all the font turned "boxes" .

  • Dropbox won't start after moving location of user folder

    Hi all I have a mid 2011 iMac running latest version of Mavericks. I recently purchased an external thunderbolt SSD and cloned my boot HD to it, excluding the user folders as these are too big for the SSD and will remain on the internal HDD, and made