Skip to main content

jQuery Sortable UI Syntax Issue



Im not quite sure what to search for to sort out this problem.





I am getting syntax error with the following code because i have 2 (no idea what to call them) in the .sortable options. Would you be able to tell me what i have done wrong with this code?





Im using a placeholder and also a connectWith from this page http://jqueryui.com/demos/sortable/#portlets and there doesnt seem to be any examples showing how to write both of them at the same time.





The syntax error is not there when i comment out







placeholder: "placeholder-highlighting"







or







connectWith: ".sortable-content"







My code is below:







$(function() {

$( ".sortable-content" ).sortable({

placeholder: "placeholder-highlighting"

connectWith: ".sortable-content"

});

$( ".sortable" ).disableSelection();

});







Bonus points for telling me what they are called!


Comments

  1. They are called options. You are calling the "sortable" method and then saying "use these options instead of the default options (if there are any)".

    You need to put a comma between each option!

    $(function() {
    $( ".sortable-content" ).sortable({
    placeholder: "placeholder-highlighting",
    connectWith: ".sortable-content"
    });
    $( ".sortable" ).disableSelection();
    });

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?