/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$(function(){ $("#contents a[href^='mailto']").after("<span class='iconmail'> </span>"); $("#contents a[href$='pdf']").after("<span class='iconpdf'> </span>").click(function(){window.open(this.href, '_blank');return false;}); $("#contents a[href$='xls']").after("<span class='iconxls'> </span>").click(function(){window.open(this.href, '_blank');return false;}); $("#contents a[href$='doc']").after("<span class='icondoc'> </span>").click(function(){window.open(this.href, '_blank');return false;}); $("#contents a[href^=http://]").not("#contents a[href^=thisPage], #contents a[href$='pdf'], #contents a[href$='xls'], #contents a[href$='doc']").after("<span class='extlink'> </span>").click(function(){ window.open(this.href, '_blank');return false; }); });