1// qTip - CSS Tool Tips - by Craig Erskine 2// http://qrayg.com 3// 4// Multi-tag support by James Crooke 5// http://www.cj-design.com 6// 7// Inspired by code from Travis Beckham 8// http://www.squidfingers.com | http://www.podlob.com 9// 10// Copyright (c) 2006 Craig Erskine 11// Permission is granted to copy, distribute and/or modify this document 12// under the terms of the GNU Free Documentation License, Version 1.3 13// or any later version published by the Free Software Foundation; 14// with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. 15// A copy of the license is included in the section entitled "GNU 16// Free Documentation License". 17 18var qTipTag = "a,label,input,th,td,img"; //Which tag do you want to qTip-ize? Keep it lowercase!// 19var qTipX = 0; //This is qTip's X offset// 20var qTipY = 15; //This is qTip's Y offset// 21 22//There's No need to edit anything below this line// 23tooltip = { 24 name : "qTip", 25 offsetX : qTipX, 26 offsetY : qTipY, 27 tip : null 28} 29 30tooltip.init = function () { 31 var tipNameSpaceURI = "http://www.w3.org/1999/xhtml"; 32 if(!tipContainerID){ var tipContainerID = "qTip";} 33 var tipContainer = document.getElementById(tipContainerID); 34 35 if(!tipContainer) { 36 tipContainer = document.createElementNS ? document.createElementNS(tipNameSpaceURI, "div") : document.createElement("div"); 37 tipContainer.setAttribute("id", tipContainerID); 38 document.getElementsByTagName("body").item(0).appendChild(tipContainer); 39 } 40 41 if (!document.getElementById) return; 42 this.tip = document.getElementById (this.name); 43 if (this.tip) document.onmousemove = function (evt) {tooltip.move (evt)}; 44 45 var a, sTitle, elements; 46 47 var elementList = qTipTag.split(","); 48 for(var j = 0; j < elementList.length; j++) 49 { 50 elements = document.getElementsByTagName(elementList[j]); 51 if(elements) 52 { 53 for (var i = 0; i < elements.length; i ++) 54 { 55 a = elements[i]; 56 sTitle = a.getAttribute("title"); 57 //if(!sTitle)sTitle = a.getAttribute("alt"); 58 if(sTitle) 59 { 60 a.setAttribute("tiptitle", sTitle); 61 a.removeAttribute("title"); 62 a.removeAttribute("alt"); 63 a.onmouseover = function() {tooltip.show(this.getAttribute('tiptitle'))}; 64 a.onmouseout = function() {tooltip.hide()}; 65 } 66 } 67 } 68 } 69} 70 71tooltip.move = function (evt) { 72 var x=0, y=0; 73 if (document.all) {//IE 74 x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft; 75 y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop; 76 x += window.event.clientX; 77 y += window.event.clientY; 78 79 } else {//Good Browsers 80 x = evt.pageX; 81 y = evt.pageY; 82 } 83 this.tip.style.left = (x + this.offsetX) + "px"; 84 this.tip.style.top = (y + this.offsetY) + "px"; 85} 86 87tooltip.show = function (text) { 88 if (!this.tip) return; 89 this.tip.innerHTML = text; 90 this.tip.style.display = "block"; 91} 92 93tooltip.hide = function () { 94 if (!this.tip) return; 95 this.tip.innerHTML = ""; 96 this.tip.style.display = "none"; 97} 98 99/*window.onload = function () { 100 tooltip.init (); 101} */
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.