how to custom position jquery-ui tooltip for each item

how to custom position jquery-ui tooltip for each item

I use default code to apply for all website have tag img or attribute is tootltip and title

  1. $(document).tooltip({
  2. track: true,
  3. items: "img, [tooltip], [title]",
  4. content: function() {
  5. var element = $( this );
  6. if ( element.is("[tooltip]") ) {
  7. var src = element.attr("tooltip");
  8. return "<img src='" + src + "' width='100'>";
  9. }
  10. if ( element.is( "[title]" ) ) {
  11. return element.attr( "title" );
  12. }
  13. if ( element.is( "img" ) ) {
  14. return element.attr( "alt" );
  15. }   
  16. }
  17. });

but in the some cases, I want to change position for another tag name
Example: with tags that have class="custome" it's will be change another position my and at, converse it's use default position. How to do it?

Sr, my english is not good