Drag and drop for PC and Tablet issues

Hi!
I’m doing a drag and drop for both PC and tablet.
I need to allow any elements (draggables) to be able to drop into any of the droppable areas and not just restrict to 1 area. I tried using the if/else statement, but I can’t seem to make it work. For example, Position 1 (droppable area) must be accept all the cases – case1, case2, case3 (draggables), but only 1 draggable on a droppable at any one time.
I hope you can help me out, or atleast helping me with the if/else statement.This is a link to my folder.https://www.box.com/s/0pksqtpmqg7zae43en66
—————————————these are my codes, in case you can’t open the file.———————————————————–
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() {
var stage = sym.$(“Stage”);
//DRAGGABLE. case1
//var _1 = sym.$(“_1″); changed _1 to _2
var _2 = sym.$(“_2″);
_2.css(“position”, “absolute”);
_2.draggable({ disabled: false });
_2.draggable({ containment: stage });
//for(var i=1; i<=9;i++){
_2.draggable({
snap: '.target1',
snapMode: 'centre'
//DROPPABLE
var position1 = sym.$("position1");
position1.css("position", "absolute");
//     position1.css("left", 375);
//     position1.css("top", 25);
//position1.on( "dropout", function( event, ui ) {
//drop into position1
position1.droppable({
accept: ".case1",
drop: function(event, ui) {
console.log(this.childNodes);
var element2 = sym.$(".Stage_position1__1Black_Eagle_id"); //Stage_position1__1Black_Eagle_id
element2.show();
_2.hide();
/*else if(_1){
var element = sym.$(".Stage_position1__2Green_Parrot_id");
element.show();
_1.hide();
// adds visual when correct drops here
//case2. _5
//DRAGGABLE
var _5 = sym.$("_5");
_5.css("position", "absolute");
_5.draggable({ disabled: false });
_5.draggable({ containment: stage });
//for(var i=1; i<=9;i++){
_5.draggable({
snap: '.target2',
snapMode: 'corner'
//DROPPABLE
var position2 = sym.$("position2");
position2.css("position", "absolute");
position2.droppable({
accept: ".case2",
drop: function(event, ui) {
console.log(this.childNodes);
var element5 = sym.$(".Stage_position2__5Black_Snake_id");
element5.show();
_5.hide();
//case3. _7
//DRAGGABLE
var _7 = sym.$("_7");
_7.css("position", "absolute");
_7.draggable({ disabled: false });
_7.draggable({ containment: stage });
_7.draggable({
snap: '.target3',
snapMode: 'corner'
//DROPPABLE
var position3 = sym.$("position3");
position3.css("position", "absolute");
position3.droppable({
accept: ".case3",
drop: function(event, ui) {
console.log(this.childNodes);
var element7 = sym.$(".Stage_position3__7Green_Praying_Mantis_id");
element7.show();
_7.hide();
});// end of codes
Can anyone help me to figure out the if/else or switch statement to be used? I tried both but it doesn' work. This is my switch statement.
var stage = sym.$(new bigElements) ;
switch (bigElements) {
//list down all the possible cases/scenarios.
  case "Stage__2":
          alert("Just like the sky!");
    break;
  case "Stage__5":
              alert("Just like shiraz!");
    break;
  case "Stage__7":
    alert("Suit yourself then...");
    break;
  default:
    alert("lalala...");
var stage = sym.$(new bigElements)
switch (bigElements) {
  case "Stage__2":
    alert("Just like the sky!");
    break;
  case "Stage__5": //"case2"
   alert("Just like shiraz!");
    break;
  case "Stage__7":
   alert("Suit yourself then...");
    break;
  default:
     alert("lalala...");
I've only included excerpt of the codes to let you have an idea of it. Thank you so much for your time.

It seems like you're asking about JS for web-pages. This forum is about JS
in PDF documents.

Similar Messages

  • I cannot drag and drop for Photos in 10.10.3

    I seem to be unable to drag and drop from the new Photos application in Yosemite 10.10.3.  I have tried this with two different applications including Adobe's Photoshop Elements 13.  It seems to work fine with other apple applications.  (can drag and drop to desktop and to pages - only two I've tried) 
    However, it is very frustrating not to be able to drag and drop from Photos to another photo editing software.  Additionally, when I try to open a file from photos while in Photoshop using the menu - Photoshop crashes.  It appears I have no way to edit my photos in Photoshop if I store them in Photos...anybody else?

    Photos is a brand new, completely rewritten application. Adobe (and others) have not yet added compatibility with it.
    Exporting your your images to the desktop, then bringing them back into Photos, is the only way for external editing right now.

  • My touch pad is no longer responding to hard press downs for drag and drop or copy and paste

    my touch pad is no longer responding to hard press downs for drag and drop or copy and paste ability

    may be a totally stupid question, but how can I tell?

  • Is there any way to disable right click and drag and drop for photos on iweb?

    Re: protecting photos when using iweb as your web designer...
    Is there any way to disable right click and drag and drop for photos using iweb?  I have seen tutorials about creating a text box around each image - but is there a better way? 

    However, there is no way you can prevent someone from making a screenshot of the image as it is displayed on the screen no matter what application you use to create the web page.
    You can add a watermark to dissuade the casual "thief" but those who are serious about stealing the photo for their own use can remove the watermark with some effort.
    OT

  • Drag and Drop for Creative Cloud CS applications

    I just joined Creative Cloud for CS software applicatons; I am already a Muse user - will I need to cancel that use and download Muse again to avoid double payment? Also, I am not able to drag and drop the CS applications at this time - is it not yet available? If not, when will it? Even the Muse app would not drag and drop for download?
    Thank you.

    Are you trying to install the applications my dragging the application icon from the Creative Cloud Apps page at https://creative.adobe.com/apps to your computer? If so that will not work since that is just an image in the web page.
    To install click on the Download (or Try for trial members) link and the Adobe Application Manager (AAM) should download and install. AAM will then handle the installation of the applications.

  • Drag and Drop Apps to and from Dock, doesn't work for one account?

    Hi there,
    I have 2 accounts on my Macbook, one of them is my main account which is admin and nothing is wrong with it. The second account though is also admin but I cannot drag and drop applications to and from the dock. I can open the program, hold left click down till it pops up with options and in which you can untick Keep in Dock. Which would be fine but as soon as the computer restarts or I log out then in again, the application reappears. Any help or ideas would be much appreciated.
    Note that I have deleted both plist files from library/preferences and I have also enabled parental controls and ticked the allow users to modify the dock option. I also tried downloading Onyx and setting it up through there but it was a no go. Anyway, if anyone has any idea then that would be awesome.
    Cheers

    TheArtieChoke wrote:
     The second account though is also admin but I cannot drag and drop applications to and from the dock.
    Ok, you can drag applications from your Applications and Utilities Folders to make a "alias" (aka shortcut) in the Dock, but if you drag the icon off and drop it, it "poof's" away as your deleting the alias. The program itself isn't in the Dock at all at any time.
    TheArtieChoke wrote:
    I can open the program, hold left click down till it pops up with options and in which you can untick Keep in Dock. Which would be fine but as soon as the computer restarts or I log out then in again, the application reappears.
    Right, when you run a program from where ever, it places a alias icon in the Dock, which you then right click and choose to keep the alias in the Dock which survives reboots and logouts/in as normal.
    If you right click and choose "open at log-in" the program will automatically run when you restart or log back into the account.
    TheArtieChoke wrote:
    Note that I have deleted both plist files from library/preferences and I have also enabled parental controls and ticked the allow users to modify the dock option. I also tried downloading Onyx and setting it up through there but it was a no go. Anyway, if anyone has any idea then that would be awesome.
    I don't see any problem, other than your not knowing the icons in the Dock are aliases.
    You should set the same user controls and preferences on the second admin as the first and your problems should disappear.
    OnyX is a great program, I recommend it highly, but I don't see it fixing your problem in this case. Unless there is something your not being clear on.

  • Can't drag and drop nor copy  and past with iMac with OS 10.8.1.

    Can't drag and drop nor copy and past with iMac with OS 10.8.1.  Not with iTunes, MS Word, nor Pages.  No where.  Reboot or relogging in helps for about an hour.  Hard reset worked for a short time. Per Apple support, most likely will reinstall the operation system.  Just wondered if anybody else has run into this.  Did a disk scan, and that was fine.  And did rebooting, holding down CMD+OPT+R, and P..  Deleted all the start up programs.  Checked the internet, no solutions there.  So it all appears to be OS redo time. 

    Do you subscribe to MLB.tv, and if so, did you install the NextDef plug in? If so, read this…
    https://discussions.apple.com/message/19185556#19185556
    I removed the NextDef plug in over 24 hours ago, restarted and haven't had a single issue with drag and drop or cut and paste since.

  • I can't copy iPhoto to my external hard drive. It will not allow me to drag and drop or copy and paste., I can't copy iPhoto to my external hard drive. It will not allow me to drag and drop or copy and paste.

    I can't copy iPhoto to my external hard drive. It will not allow me to drag and drop or copy and paste., I can't copy iPhoto to my external hard drive. It will not allow me to drag and drop or copy and paste.

    NTFS is your problem.
    iPhoto needs to have the Library sitting on disk formatted Mac OS Extended (Journaled). Users with the Library sitting on disks otherwise formatted regularly report issues including, but not limited to, importing, exporting, saving edits and sharing the photos.
    See this article
    http://support.apple.com/kb/TS5168
    for more. Note also the comment:
    “Additionally, storing the iPhoto library on a network rather than locally on your computer can also lead to poor performance or data loss.”

  • Drag and drop the text and image

    Hi,
    I need help in drag and drop text and image.
    I am able to drag and drop the text and image in doc but  i want to drag the text in text frame and image in image frame only.
    For this how to get textframe id or is there any other way to do this. Pls help me if anyone know how to do this one.
    Thanks
    Arun

    This thread is pretty old, but this can help anyone in the future:
    To handle a drop in InDesign, you have to implement your own custom CDragDropTargetFlavorHelper. You can find a working example in SDK Sample. Take a look at BasicDragDrop.sdk project in the SDK.

  • Drag and Drop between JTree and Labels in 2 different panes

    Hi,
    I am using JDK 1.4.1 and am trying to implement Drag n Drop between a JTree and JLabels with ImageIcons, both on different panes.
    I got the DnD working fine on the tree. but i cant get to drag and drop the label from the other pane, on the Jtree as a node. I am getting confused with the DataFlavors, and also wonder if there is something else that i have to do for DnD between 2 panes. Can someone give me any leads on this, please? The Panes I am talking about are splitpanes.
    thanks,
    Sri.

    hey thanks Dennis!! I was hoping you would respond to my question, as I have seen a lot of your replies. yes, the example you gave would be helpful. but i am trying to implement this in 1.4.1, with the new drag and drop in swing. and i am getting confused wiht theh data flavors etc.
    my problem at hand is :
    I have a tree on the left pane. i can drag and drop the nodes on the tree itself. (i already did that...no problem). I have Jlabels with imageicons (actually wrapper classes with labels and imageicons) on the right pane. i have to be able to drag these labels to the tree such that they form a node.
    I have one class the NodeSelection class which extends TransferHandler and implements Transferable. i was able to do DnD for the tree using this. I customized the importData method in this.I thought that i can just use the same class to create the transferhandler and transferable, and just use a different implementation for the importData method if the data being dragged is from the label.
    well, my thoughts and ideas were ok...but i can implement it...so they must be wrong ;-)
    Can u please suggest another way to do this. I have a deadline to meet and am stuck here :-( any suggestions or tips or hints would be very helpful and appreciated!!
    Thanks,
    Sri.

  • I can't drag and drop or cut and paste all of a sudden! Help

    I can't drap and drop or cut and paste all of a sudden.  I updated my windows suite and ditched the old stuff.  The next day no drag, drop, cut and paste.
    <Email Edited By Host>

    *FireFTP: https://addons.mozilla.org/firefox/addon/fireftp/

  • Can't Drag and Drop, or cut and paste

    Weirdest thing - all of a sudden I can't drag and drop, or cut and paste. I fixed permissions, deleted varied preference files and rebooted, reset the permissions on /tmp, etc. and still no go.
    Any suggested avenues to find what the possible problem is, and how to solve (short of reinstalling)?

    On the left side of the browser at the top of the iPhoto window you will see two symbols. The top one looks like a sheet of paper with the corner folded down, the bottom looks like multiple sheets/cards. If you click on the top symbol, you will view thumbnails of the pages in the book; the bottom gives you photos. At the bottom left of the window, there are two buttons above the word "view". Clicking on one button versus the other changes the window to view either one or two pages. This also affects whether or not the pages are locked together in the browser. When you are in page view, you can drag and drop pages in the browser to create the order you wish.
    I hope this helps.

  • Did up date for 10.7.4 to 10.7.5 and update for Aperture and now  Aperture doesn't open.  How do I fix?

    Did up date for 10.7.4 to 10.7.5 and update for Aperture and now  Aperture doesn't open.  How do I fix?

    I heard dump the app and reinstall?  How do I go about that?

  • Users of imovie experience a lot of problems and crying for help and no one at Apple did not respond I do not understand how a company like Apple puts experts to help users Please note that anonymous experts in Internet offer their help for money

    Users of imovie experience a lot of problems and crying for help and no one at Apple did not respond
    I do not understand how a company like Apple puts experts to help users
    Please note that anonymous experts in Internet offer their help for money

    Users of imovie experience a lot of problems and crying for help and no one at Apple did not respond
    I do not understand how a company like Apple puts experts to help users
    Please note that anonymous experts in Internet offer their help for money

  • Help me plz.. i,ve got a apple i phone 4 and i'm the 2 owner of it and i dont have it's apple id and passward for it and 1st owner doesnt know it too so what can i do for this plz help me....

    help me plz.. i,ve got a apple i phone 4 and i'm the 2 owner of it and i dont have it's apple id and passward for it and 1st owner doesnt know it too so what can i do for this plz help me....

    Neither can we.  Only the original owner can help you, surely he/she can reset their password.

Maybe you are looking for

  • Edit video without importing locally?

    I'm brand new to Final Cut and FCPX is my first experience with the product. I have a Mac Mini server with a thunderbolt-attached storage array that I'm using to store my raw footage. I'm editing video on my MacBook Air using the storage device mount

  • How can I change my iPad iTunes email address to match my mac pro iTunes email address.

    My iPad iTunes email address is different from my Mac pro iTunes email address.  Tried changing my iPad meal address to match my Mac pro and said I could not.

  • My Mac OS 10.4.6 won't boot normally after new updates?

    Pardon the fact that I'm a newbie... It seems like a lot of people are posting about problems with the latest Mac OS updates. I installed some new updates Sunday night, and the system needed to be rebooted. I was working, multitasking with Fire and W

  • App store problem with iPhoto update

    Today I went to the App Store.  An update was available for iPhoto.  When I clicked on it I got a notice that I needed to accept new conditions, when I clicked on "O.K" after a while I got the message that I was not connected to the App Store. I have

  • Determining the Serial port number

    I need to test my board on 3 PCs randomly.Each time i connect the board the serial port number like "com 18" is getting changed.Now the comport number i am using is 40.Though i dont any other USB connection.Though i refresh i still get  the data only