jquery

jquery Form Hint plugin (mine)

This is my view of form hint plugin: show a div over with the title content inside, instead of replace text in input elements and match it with placeholder
simply run $(selector).formHint() on all form element and title is used as hint


See also http://code.google.com/p/jquery-watermark/

Ajax frontend for my backoffice in jQuery and PHP

This is my way to organize php for a simple jQuery frontend ajax based:

1.in a administration page include the php that generate html for each box
2.for each box setup behavior in Javascript
3.let each php manage POST request (for change/update) and GET request for show content


So in admin.php we could have something like that

jQuery Waiting plugin

This is a simple jQuery plugin for purpose of loading phase of an ajax request or anything else.
$("#testdiv").waiting({imgsrc:"/files/aj-blue.gif"});
to stop a waiting div
$("#testdiv").stopWaiting();

move multiple option in select with jQuery

I look for this everywhere: how to move multiple option inside a select
function upfield() {
  var el = $('#selectedfield').children('[@selected]:first').prev();
  $("#selectedfield")
    .children('[@selected]')
    .each(function(){
	$(this).insertBefore(el);
      });

}

function downfield() {
  var el = $('#selectedfield').children('[@selected]:last').next();
  $("#selectedfield")
    .children('[@selected]')
    .each(function(){
	$(this).insertAfter(el);
	el = $(el).next();
      });
}