Define Latin Words on Your Webpage!
Add this code between your webpage's head tags to make double-clicking any word define it in Latin:
function popup(word) { var url="http://www.perseus.tufts.edu/hopper/morph?la=la&l="; var width=screen.width*0.75; var height=screen.height*0.75; var left=(screen.width-width)/2; var top=(screen.height-height)/2; var params="width="+width+",height="+height; params+=",top="+top+",left="+left; params+=",directories=no"; params+=",location=no"; params+=",menubar=no"; params+=",resizable=yes"; params+=",scrollbars=yes"; params+=",status=no"; params+=",toolbar=no"; newwin=window.open(url+word,"Lewis & Short",params); if(window.focus){ newwin.focus(); } return false; } document.ondblclick=goPage; function findSelection() { if(document.getSelection) { txt=document.getSelection(); } else if(document.selection) { txt=document.selection.createRange().text; } else { return ""; } return txt; } function goPage() { var word=findSelection(); if(word!="") { popup(word); } }
Copy to Clipboard
Download the
source here
.