/ Published in: jQuery
U must have animation image here " /images/ajax-loader.gif"
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function show_loading(obj,where){ if(!$('div#loading').length){ $('body').append("<div id='loading'><img src='/images/ajax-loader.gif' /></div>") } var off = obj.offset() left_d = off.left-18 if(where){ switch(where){ case 'left': left_d = off.left-18 break; case 'right': left_d = off.left+obj.width()+10 break; } } var csss = { 'top':off.top, 'left':left_d } $('div#loading').show().css(csss); }