|
Indicating Sarcasm I came up with the idea of putting everything sarcastic in blue.
At first glance it sounded good but the whole point of sarcasm is that
the humor of the statement sinks in after much of it's been said. An immediate
indicator of sarcasm such as blue text just serves to ruin the humor in
the statement.
<script language="JavaScript">
<!--
document.getElementsByClassName = function(cl) {
var retnode = [];
var myclass = new RegExp('\\b'+cl+'\\b');
var elem = this.getElementsByTagName('*');
for (var i = 0; i < elem.length; i++) {
var classes = elem[i].className;
if (myclass.test(classes)) retnode.push(elem[i]);
}
return retnode;
};
sfHover = function() {
if (document.all && document.getElementById) {
var sfEls = document.getElementsByClassName("sarcasm");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" shover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" shover\\b"), "");
}
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
// -->
</script>
Now all you have to do in your source code is put <span class="sarcasm" title="(sarcasm)">Sarcastic Saying</span>
I know some folks out there might be hesitent to implement this because
people might confuse sarcastic text with link text, but this script does
not turn the person's curser into a finger, which is a link indicator.
Back to Main |
|