<html> <head> <title>ÇØÇÇCGI</title> <script type="text/javascript"> <!-- // Adds DIV tags containing the ANCHORs' titles function add_titles(cls) { var as = document.getElementsByTagName('a'); var i = 0;
// Traverse all the ANCHOR tags while (i < as.length) { var a = as.item(i); i++;
// Check if the tag's class is what we have to alter. if (a.className != cls) { continue; }
// Check if the next DIV already contains the title if (a.nextSibling && a.nextSibling.nodeName == 'DIV' && a.nextSibling.firstChild && a.nextSibling.firstChild.nodeName == '#text' && a.nextSibling.firstChild.nodeValue == a.title) { continue; }
var title = document.createElement("div"); title.appendChild(document.createTextNode(a.title));
a.parentNode.insertBefore(title, a.nextSibling); } }
// Removes DIV tags containing the ANCHORs' titles function remove_titles(cls) { var as = document.getElementsByTagName('a'); var i = 0;
// Traverse all the ANCHOR tags while (i < as.length) { var a = as.item(i); i++;
// Check if the tag's class is what we have to alter. if (a.className != cls) { continue; }
// Remove the next DIV containing the anchor title if (a.nextSibling && a.nextSibling.nodeName == 'DIV' && a.nextSibling.firstChild && a.nextSibling.firstChild.nodeName == '#text' && a.nextSibling.firstChild.nodeValue == a.title) { a.parentNode.removeChild(a.nextSibling); } } }
function toggle_titles() { // !!!! Change this to actual ANCHOR tag class !!!! var anchorsClassName = 'test';
var box = document.getElementById('toggle_titles_checkbox');
if (box.checked) add_titles(anchorsClassName); else remove_titles(anchorsClassName); }
// Handle the old user agents - no checkbox // will appear if the user agent doesn't support DOM2. if (document.getElementsByTagName) { document.write( '<input id="toggle_titles_checkbox" type="checkbox" ' + 'onclick="toggle_titles()">¸µÅ© ¼³¸íÀ» º¸¿©ÁÖ¼¼¿ä.<br>');
if (window.addEventListener) window.addEventListener("load", toggle_titles, false); else if (window.addEvent) window.addEvent("load", toggle_titles); } //--> </script>
</head> <body>
<a href="http://www.naver.com" class="test" title="Ŭ¸¯ÇÏ¸é ³×À̹ö·Î °¡¿ä..">³×À̹ö</a><br> <a href="http://www.daum.net" class="test" title="Ŭ¸¯ÇÏ¸é ´ÙÀ½À¸·Î °¡¿ä..">DAUM</a><br> <a href="http://www.happycgi.com" class="test" title="Ŭ¸¯Çϸé ÇØÇÇCGI·Î °¡¿ä..">HAPPYCGI</a><br> <a href="http://www.cgimall.co.kr" class="test" title="Ŭ¸¯Çϸé CGI¸ô·Î °¡¿ä..">CGIMALL</a><br>
</body> </html>
|