📄 tooltipsetter.js
字号:
// Association de Tooltip aux objets class="tooltip" de la pageEvent.observe(window, "load", function(){ $$(".tooltip").findAll( function(node) { return node.getAttribute("title"); } ).each( function(node) { width = node.getAttribute("width"); if (width) new Tooltip(node,node.title, width); else { new Tooltip(node,node.title); } node.removeAttribute("title"); } ); //loop through all element with a tooltip-taxes class //add a tool tip on mouseover //remove it when mouseout //ha to be done this way (and not rely only on the new Tooltip constructor) //because the tooltip has to be recreated each time the link is hovered over //to account for currency changes $$(".tooltip-taxes").each( function(element) { //hide element which contain the tooltip text var content_element = element.next('.tooltip-taxes-content'); content_element.hide(); Event.observe( element, 'mouseover', function(e){ var element = Event.element(e); if(element.tooltip) { element.tooltip.hideTooltip(e); element.tooltip.destroy(); } var content_element = element.next('.tooltip-taxes-content'); var content_text = content_element.innerHTML;//.stripTags(); if ($('iframe-multirates')) element.tooltip = new Tooltip(element, content_text,260, -165, -120); else if ($('iframe-upsale')) element.tooltip = new Tooltip(element, content_text,260, -310, -120); else element.tooltip = new Tooltip(element, content_text,260, -310, -120); element.tooltip.showTooltip(e); } ); Event.observe( element, 'mouseout', function(e){ var element = Event.element(e); if(element.tooltip) { element.tooltip.hideTooltip(e); element.tooltip.destroy(); } } ); } ); });
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -