var ddimgtooltip={ tiparray:function(){ var tooltips=[] tooltips[1]=["images/chainage_hor.jpg","chaînage horizontal\01"] tooltips[2]=["images/rampannage.jpg","Rampannage\02"] tooltips[3]=["images/maconnerie_brique.jpg","Maçonnerie de briques\03"] tooltips[4]=["images/linteau_beton.jpg","Linteau béton\04"] tooltips[5]=["images/cheminee.jpg","Souche de cheminée\05"] tooltips[6]=["images/escalier.jpg","Escalier bétonscellé dans un chevêtre béton\06"] tooltips[7]=["images/tremie.jpg","Trémie d'escalier\07"] tooltips[8]=["images/appuis-fenetre.jpg","Appui de fenêtreavec bande de redressement\08"] tooltips[9]=["images/maconnerie_agglos.jpg","Maçonnerie d'agglos\09"] tooltips[10]=["images/enduit_1.jpg","Enduit gratté\10"] tooltips[11]=["images/dalle.jpg","Plancher bétonpoutrelle, hourdis, treillis soudé, dalle de compression, isorupteur\11"] tooltips[12]=["images/semelle.jpg","Semelle béton\12"] tooltips[13]=["images/chainage_verticale.jpg","Chaînage verticalou poteau raidisseur\13"] tooltips[14]=["images/enduit_hydro.jpg","Enduit hydrofugesur mur enterré\14"] tooltips[15]=["images/pilier.jpg","Pilier de barrière\15"] tooltips[16]=["images/eaux-usees.jpg","Réseau d'eaux usées\16"] tooltips[17]=["images/couvertines.jpg","Couvertines\17"] tooltips[18]=["images/chapeau_pilier.jpg","Chapeau de pilier\18"] tooltips[19]=["images/empilement.jpg","Empierrement sous dallage\19"] tooltips[20]=["images/maconnerie_angle.jpg","Angle granit\20"] tooltips[21]=["images/seuil.jpg","Seuil en béton\21"] tooltips[22]=["images/linteau_granit.jpg","Linteau granit\22"] tooltips[23]=["images/maconnerie_pierre.jpg","Maçonnerie de pierre\23"] tooltips[24]=["images/terrasse.jpg","Terrasse béton\24"] tooltips[25]=["images/beche.jpg","Bêche en béton\25"] tooltips[26]=["images/poteau_beton.jpg","Poteau béton\26"] tooltips[27]=["images/poutre_beton.jpg","Poutre béton\27"] tooltips[28]=["images/conduit.jpg","Conduit de fumée\28"] tooltips[29]=["images/ceinture.jpg","CEinture\29"] tooltips[30]=["images/ceinture.jpg","CEinture\30"] tooltips[31]=["images/ceinture.jpg","CEinture\3"] tooltips[32]=["images/ceinture.jpg","CEinture\20"] tooltips[33]=["images/ceinture.jpg","CEinture\20"] tooltips[34]=["images/ceinture.jpg","CEinture\20"] tooltips[35]=["images/ceinture.jpg","CEinture\20"] tooltips[36]=["images/ceinture.jpg","CEinture\20"] tooltips[37]=["images/ceinture.jpg","CEinture\20"] tooltips[38]=["images/ceinture.jpg","CEinture\20"] tooltips[39]=["images/ceinture.jpg","CEinture\20"] return tooltips //do not remove/change this line }(), tooltipoffsets: [20, -5], //additional x and y offset from mouse cursor for tooltips //***** NO NEED TO EDIT BEYOND HERE tipprefix: 'imgtip', //tooltip ID prefixes createtip:function($, tipid, tipinfo){ if ($('#'+tipid).length==0){ //if this tooltip doesn't exist yet return $('
').html( '
' + ((tipinfo[1])? '
'+tipinfo[1]+'
' : '') ) .css(tipinfo[2] || {}) .appendTo(document.body) } return null }, positiontooltip:function($, $tooltip, e){ var x=e.pageX+this.tooltipoffsets[0], y=e.pageY+this.tooltipoffsets[1] var tipw=$tooltip.outerWidth(), tiph=$tooltip.outerHeight(), x=(x+tipw>$(document).scrollLeft()+$(window).width())? x-tipw-(ddimgtooltip.tooltipoffsets[0]*2) : x y=(y+tiph>$(document).scrollTop()+$(window).height())? $(document).scrollTop()+$(window).height()-tiph-10 : y $tooltip.css({left:x, top:y}) }, showbox:function($, $tooltip, e){ $tooltip.show() this.positiontooltip($, $tooltip, e) }, hidebox:function($, $tooltip){ $tooltip.hide() }, init:function(targetselector){ jQuery(document).ready(function($){ var tiparray=ddimgtooltip.tiparray var $targets=$(targetselector) if ($targets.length==0) return var tipids=[] $targets.each(function(){ var $target=$(this) $target.attr('rel').match(/\[(\d+)\]/) //match d of attribute rel="imgtip[d]" var tipsuffix=parseInt(RegExp.$1) //get d as integer var tipid=this._tipid=ddimgtooltip.tipprefix+tipsuffix //construct this tip's ID value and remember it var $tooltip=ddimgtooltip.createtip($, tipid, tiparray[tipsuffix]) $target.mouseenter(function(e){ var $tooltip=$("#"+this._tipid) ddimgtooltip.showbox($, $tooltip, e) }) $target.mouseleave(function(e){ var $tooltip=$("#"+this._tipid) ddimgtooltip.hidebox($, $tooltip) }) $target.mousemove(function(e){ var $tooltip=$("#"+this._tipid) ddimgtooltip.positiontooltip($, $tooltip, e) }) if ($tooltip){ //add mouseenter to this tooltip (only if event hasn't already been added) $tooltip.mouseenter(function(){ ddimgtooltip.hidebox($, $(this)) }) } }) }) //end dom ready } } //ddimgtooltip.init("targetElementSelector") ddimgtooltip.init("*[rel^=imgtip]")