Offset returning null always...
I try to get the offset and set it as a position but it always returns as zero... any ideas on fixing that?
-
(function($){
$.fn.extend({
bstip: function() {
return this.each(function(i){
var nowid=$(this).id, nowtitle=$(this).attr("title");
here=$(this);
//Math Vars
var offset = here.offset();
nowidth=$(this).width();
nowheight=$(this).height();
$("body").append("<div class='bstip' id='bs"+i+"'><p>"+nowtitle+"</p></div>");
$('#bs'+i).css({"top":offset.top+"px","left":offset.left+"px","position":"absolute"});
$('#bs'+i).append("poop");
var bs_tooltip = $("#bs"+i);
$(this).removeAttr("title").mouseover(function(){
bs_tooltip.css({"opacity":.8}).fadeIn("fast");
}).mouseout(function(){
bs_tooltip.fadeOut("fast");
});
});
}
});
})(jQuery);