Forum:How to .. use javascript to reorder the widget carousel

Could any JS/jQuery expert please explain to me why my attempts (below) to reorder the list of widgets in the so-called cockpit have not been successful?

/* reorder the widgets in the widget carousel to promote the "Wiki page in widget" */ function reorderCockpit { // $("#widget_cockpit-item-22").insertBefore("#widget_cockpit-item-1"); $("#widget_cockpit_list > #widget_cockpit-item-22").prependTo("#widget_cockpit_list"); } $(reorderCockpit); I suspect the problem has something to do with when the above function is being called relative to that moment in time when the user causes the so-called widget carousel (a.k.a. cockpit) to appear. If you understand these subtle matters then please explain here.

-- najevi 12:37, November 22, 2009 (UTC)


 * The safest thing to do is to re-arrange all widgets. Use the appendChild function with every item in the order you want them to appear. But if wikia adds another widget, it will appear at the beginning, so you'll need to edit the script to add the latest. --Ciencia Al Poder (talk) -WikiDex 15:50, November 27, 2009 (UTC)