javascript - Tooltip alignment issue in IE9 and IE10 -


i perl developer.

i told add tooltip few of our links. added code in our page. tooltip event occurs on onmouseover event.

please have @ screenshot:

enter image description here

but not appear proper in ie9 , ie10

please have @ screenshot:

enter image description here

i added postion: absolute , postion: relative both css not solve issue. please help.

found same topic here not understand, changes need make!

my code:

<a onmouseover="this.t_above=true;this.t_offsety=25;this.t_width=150;this.t_static=true;this.t_delay=100;return escape('click here read more.');" target="_blank" href="#" class="blue_link">aol accidentally released</a> 

tooltip.js file:

var ttbgcolor="#e6ecff";var ttbgimg="";var ttbordercolor="#003399";var ttborderwidth=1;var ttdelay=500;var ttfontcolor="#000066";var ttfontface="arial,helvetica,sans-serif";var ttfontsize="11px";var ttfontweight="normal";var ttoffsetx=8;var ttoffsety=19;var ttpadding=3;var ttshadowcolor="";var ttshadowwidth=0;var tttitlecolor="#ffffff";var ttwidth=300;var tt_tags=new array("a","area","b","big","caption","center","code","dd","div","dl","dt","em","h1","h2","h3","h4","h5","h6","i","img","input","li","map","ol","p","pre","s","small","span","strike","strong","sub","sup","table","td","th","tr","tt","u","var","ul","layer");var tt_obj,tt_objw=0,tt_objh=0,tt_objx=0,tt_objy=0,tt_offx=0,tt_offy=0,xlim=0,ylim=0,tt_above=false,tt_static=false,tt_sticky=false,tt_wait=false,tt_vis=false,tt_dwn=false,tt_u="undefined",tt_inputs=new array();var tt_db=(document.compatmode&&document.compatmode!="backcompat")?document.documentelement:document.body?document.body:null,tt_n=navigator.useragent.tolowercase();var tt_op=!!(window.opera&&document.getelementbyid),tt_op6=tt_op&&!document.defaultview,tt_ie=tt_n.indexof("msie")!=-1&&document.all&&tt_db&&!tt_op,tt_n4=(document.layers&&typeof document.classes!="undefined"),tt_n6=(!tt_op&&document.defaultview&&typeof document.defaultview.getcomputedstyle!="undefined"),tt_w3c=!tt_ie&&!tt_n6&&!tt_op&&document.getelementbyid;tt_n="";function tt_int(b){var a;return isnan(a=parseint(b))?0:a}function wzreplace(b,a){var d="",c=this,e;while((e=c.indexof(b))!=-1){d+=c.substring(0,e)+a;c=c.substring(e+b.length)}return d+c}string.prototype.wzreplace=wzreplace;function tt_n4tags(b,e,a){e=e||document;a=a||new array();var c=(b=="a")?e.links:e.layers;for(var d=c.length;d--;){a[a.length]=c[d]}for(var d=e.layers.length;d--;){a=tt_n4tags(b,e.layers[d].document,a)}return a}function tt_getselects(){if(!tt_op6&&!tt_ie){return}var b=tt_op6?"input":"select";if(document.all){var a=document.all.tags(b).length;while(a--){tt_inputs[a]=document.all.tags(b)[a]}}else{if(document.getelementsbytagname){var a=document.getelementsbytagname(b).length;while(a--){tt_inputs[a]=document.getelementsbytagname(b)[a]}}}var a=tt_inputs.length;while(a--){tt_inputs[a].x=0;tt_inputs[a].y=0;var c=tt_inputs[a];while(c){tt_inputs[a].x+=c.offsetleft||0;tt_inputs[a].y+=c.offsettop||0;c=c.offsetparent}}}function tt_htm(a,j,k){var q=(typeof a.t_bgcolor!=tt_u)?a.t_bgcolor:ttbgcolor,r=(typeof a.t_bgimg!=tt_u)?a.t_bgimg:ttbgimg,b=(typeof a.t_bordercolor!=tt_u)?a.t_bordercolor:ttbordercolor,o=(typeof a.t_borderwidth!=tt_u)?a.t_borderwidth:ttborderwidth,h=(typeof a.t_fontface!=tt_u)?a.t_fontface:ttfontface,i=(typeof a.t_fontcolor!=tt_u)?a.t_fontcolor:ttfontcolor,p=(typeof a.t_fontsize!=tt_u)?a.t_fontsize:ttfontsize,n=(typeof a.t_fontweight!=tt_u)?a.t_fontweight:ttfontweight,c=(typeof a.t_padding!=tt_u)?a.t_padding:ttpadding,m=(typeof a.t_shadowcolor!=tt_u)?a.t_shadowcolor:(ttshadowcolor||0),g=(typeof a.t_shadowwidth!=tt_u)?a.t_shadowwidth:(ttshadowwidth||0),d=(typeof a.t_title!=tt_u)?a.t_title:"",l=(typeof a.t_titlecolor!=tt_u)?a.t_titlecolor:tttitlecolor,t=(typeof a.t_width!=tt_u)?a.t_width:ttwidth;if(m||g){m=m||"#cccccc";g=g||3}if(tt_n4&&(p=="10px"||p=="11px")){p="12px"}var s='<div class="tooltip1" id="'+j+'" style="position:absolute;z-index:300000;';s+="left:0px;top:0px;width:"+(t+g)+"px;visibility:"+(tt_n4?"hide":"hidden")+';">';s+='<table border="0" cellpadding="0" cellspacing="0"'+(b?(' bgcolor="'+b+'"'):"")+' width="'+t+'">';if(d){s+='<tr><td style="padding-left:3px;"><font color="'+l+'" face="'+h+'" ';s+='style="color:'+l+";font-family:"+h+";font-size:"+p+';"><b>';s+=d+"</b></font></td></tr>"}s+='<tr><td><table border="0" cellpadding="'+c+'" cellspacing="'+o+'" width="100%">';s+="<tr><td"+(q?(' bgcolor="'+q+'"'):"")+(r?' background="'+r+'"':"");if(tt_n6){s+=' style="padding:'+c+'px;"'}s+='><font color="'+i+'" face="'+h+'"';s+=' style="color:'+i+";font-family:"+h+";font-size:"+p+";font-weight:"+n+';">';if(n=="bold"){s+="<b>"}s+=k;if(n=="bold"){s+="</b>"}s+="</font></td></tr></table></td></tr></table>";if(g){var f=math.round(g*1.3);if(tt_n4){s+='<layer bgcolor="'+m+'" left="'+t+'" top="'+f+'" width="'+g+'" height="0"></layer>';s+='<layer bgcolor="'+m+'" left="'+f+'" align="bottom" width="'+(t-f)+'" height="'+g+'"></layer>'}else{var e=tt_n6?"-moz-opacity:0.85;":tt_ie?"filter:alpha(opacity=85);":"";s+='<div id="'+j+'r" style="position:absolute;background:'+m+";left:"+t+"px;top:"+f+"px;width:"+g+"px;height:1px;overflow:hidden;"+e+'"></div>';s+='<div style="position:relative;background:'+m+";left:"+f+"px;top:0px;width:"+(t-f)+"px;height:"+g+"px;overflow:hidden;"+e+'"></div>'}}s+="</div>";return s}function tt_init(){if(!(tt_op||tt_n4||tt_n6||tt_ie||tt_w3c)){return}var f=tt_n4?'<div style="position:absolute;"></div>':"",e,c,h,b="return escape(";var g=tt_tags.length;while(g--){e=tt_ie?(document.all.tags(tt_tags[g])||1):document.getelementsbytagname?(document.getelementsbytagname(tt_tags[g])||1):(!tt_n4&&tt_tags[g]=="a")?document.links:1;if(tt_n4&&(tt_tags[g]=="a"||tt_tags[g]=="layer")){e=tt_n4tags(tt_tags[g])}var d=e.length;while(d--){if(typeof(c=e[d]).onmouseover=="function"&&c.onmouseover.tostring().indexof(b)!=-1&&!tt_n6||tt_n6&&(h=c.getattribute("onmouseover"))&&h.indexof(b)!=-1){if(h){c.onmouseover=new function(h)}var a=unescape(c.onmouseover());f+=tt_htm(c,"tooltip"+g+""+d,a.wzreplace("& ","&"));c.onmouseover=new function("e",'tt_show(e,"tooltip'+g+""+d+'",'+(typeof c.t_above!=tt_u)+","+((typeof c.t_delay!=tt_u)?c.t_delay:ttdelay)+","+((typeof c.t_fix!=tt_u)?'"'+c.t_fix+'"':'""')+","+(typeof c.t_left!=tt_u)+","+((typeof c.t_offsetx!=tt_u)?c.t_offsetx:ttoffsetx)+","+((typeof c.t_offsety!=tt_u)?c.t_offsety:ttoffsety)+","+(typeof c.t_static!=tt_u)+","+(typeof c.t_sticky!=tt_u)+");");c.onmouseout=tt_hide;if(c.alt){c.alt=""}if(c.title){c.title=""}}}}document.write(f)}function tt_evx(c){var a=tt_int(c.pagex||c.clientx||0)+tt_int(tt_ie?tt_db.scrollleft:0)+tt_offx;if(a>xlim){a=xlim}var b=tt_int(window.pagexoffset||(tt_db?tt_db.scrollleft:0)||0);if(a<b){a=b}return a}function tt_evy(b){var a=tt_int(b.pagey||b.clienty||0)+tt_int(tt_ie?tt_db.scrolltop:0);if(tt_above){a-=(tt_objh+tt_offy-(tt_op?31:15))}else{if(a>ylim||!tt_dwn&&a>ylim-24){a-=(tt_objh+5);tt_dwn=false}else{a+=tt_offy;tt_dwn=true}}return a}function tt_releasmov(){if(document.onmousemove==tt_move){if(document.releaseevents){document.releaseevents(event.mousemove)}document.onmousemove=null}}function tt_hideinput(){if(!(tt_ie||tt_op6)||!tt_inputs){return}var b;var a=tt_inputs.length;while(a--){b=tt_inputs[a];if(tt_vis&&tt_objx+tt_objw>b.x&&tt_objx<b.x+b.offsetwidth&&tt_objy+tt_objh>b.y&&tt_objy<b.y+b.offsetheight){b.style.visibility="hidden"}else{b.style.visibility="visible"}}}function tt_getdiv(a){return(tt_n4?(document.layers[a]||null):tt_ie?(document.all[a]||null):(document.getelementbyid(a)||null))}function tt_getdivw(){return(tt_n4?tt_obj.clip.width:tt_obj.style.pixelwidth?tt_obj.style.pixelwidth:tt_obj.offsetwidth)}function tt_getdivh(){return(tt_n4?tt_obj.clip.height:tt_obj.style.pixelheight?tt_obj.style.pixelheight:tt_obj.offsetheight)}function tt_setdivz(){var a=tt_obj.style||tt_obj;if(window.dd&&dd.z){a.zindex=math.max(dd.z+1,a.zindex)}}function tt_setdivpos(b,a){var d=tt_obj.style||tt_obj;var c=(tt_op6||tt_n4)?"":"px";d.left=(tt_objx=b)+c;d.top=(tt_objy=a)+c;tt_hideinput()}function tt_showdiv(a){if(tt_n4){tt_obj.visibility=a?"show":"hide"}else{tt_obj.style.visibility=a?"visible":"hidden"}tt_vis=a;tt_hideinput()}function tt_show(i,d,l,e,f,g,k,j,n,c){if(tt_obj){tt_hide()}var a=document.onmousemove||null;if(window.dd&&(window.drag&&a==drag||window.resize&&a==resize)){return}var b=document.onmouseup||null;if(a&&b){b(i)}tt_obj=tt_getdiv(d);if(tt_obj){tt_dwn=!(tt_above=l);tt_static=n;tt_sticky=c;tt_objw=tt_getdivw();tt_objh=tt_getdivh();tt_offx=g?-(tt_objw+k):k;tt_offy=j;if(tt_op){tt_offy+=21}if(tt_n4){if(tt_obj.document.layers.length){var m=tt_obj.document.layers[0];m.clip.height=tt_objh-math.round(m.clip.width*1.3)}}else{var m=tt_getdiv(d+"r");if(m){var h=tt_objh-tt_int(m.style.pixeltop||m.style.top||0);if(typeof m.style.pixelheight!=tt_u){m.style.pixelheight=h}else{m.style.height=h+"px"}}}tt_getselects();xlim=tt_int((tt_db&&tt_db.clientwidth)?tt_db.clientwidth:window.innerwidth)+tt_int(window.pagexoffset||(tt_db?tt_db.scrollleft:0)||0)-tt_objw-(tt_n4?21:0);ylim=tt_int(window.innerheight||tt_db.clientheight)+tt_int(window.pageyoffset||(tt_db?tt_db.scrolltop:0)||0)-tt_objh-tt_offy;tt_setdivz();i=i||window.event;if(f){tt_setdivpos(tt_int((f=f.split(","))[0]),tt_int(f[1]))}else{tt_setdivpos(tt_evx(i),tt_evy(i))}window.tt_rdl=window.settimeout("if (tt_sticky){tt_releasmov();window.tt_upfunc = document.onmouseup || null;if (document.captureevents) document.captureevents(event.mouseup);document.onmouseup = new function(\"window.settimeout('tt_hide();', 10);\");}else if (tt_static) tt_releasmov();tt_showdiv('true');",e);if(!f){if(document.captureevents){document.captureevents(event.mousemove)}document.onmousemove=tt_move}}}var tt_area=false;function tt_move(a){if(!tt_obj){return}if(tt_n6||tt_w3c){if(tt_wait){return}tt_wait=true;settimeout("tt_wait = false;",5)}var b=a||window.event;tt_setdivpos(tt_evx(b),tt_evy(b));if(tt_op6){if(tt_area&&b.target.tagname!="area"){tt_hide()}else{if(b.target.tagname=="area"){tt_area=true}}}}function tt_hide(){if(window.tt_obj){if(window.tt_rdl){window.cleartimeout(tt_rdl)}if(!tt_sticky||tt_sticky&&!tt_vis){tt_showdiv(false);tt_setdivpos(-tt_objw,-tt_objh);tt_obj=null;if(typeof window.tt_upfunc!=tt_u){document.onmouseup=window.tt_upfunc}}tt_sticky=false;if(tt_op6&&tt_area){tt_area=false}tt_releasmov();tt_hideinput()}}tt_init(); 


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -