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)