From f7ede187da1e5230816c4563d2877a4b9a4aa589 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 26 Jun 2011 01:37:37 +0530 Subject: [PATCH] make links open in new window --- radia.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/radia.js b/radia.js index c4e7114..00f2a64 100644 --- a/radia.js +++ b/radia.js @@ -34,12 +34,23 @@ $(function() { }); $texts.push($this); + var highlightShadow = '2px 2px 1px #666'; + var highlightCSS = { + 'fontWeight': 'bold', + 'backgroundColor': '#ffff00' + } + + var unhighlightCSS = { + 'fontWeight': 'normal', + 'backgroundColor': '#ffffff' + } + $this.mouseover(function(e) { var typ = $(this).data("type"); for (var i=0; i<$texts.length;i++) { var $t = $texts[i]; if ($t.data("type") == typ) { - $t.css({'fontWeight': 'bold'}); + $t.css(highlightCSS); } } // $('.' + cls).addClass("highlighted"); @@ -51,14 +62,15 @@ $(function() { for (var i=0; i<$texts.length;i++) { var $t = $texts[i]; if ($t.data("type") == typ) { - $t.css({'fontWeight': 'normal'}); + $t.css(unhighlightCSS); } } // $('.' + cls).removeClass("highlighted"); }); $this.click(function() { - console.log($(this).data("link")); + window.open($(this).data("link")); +// console.log($(this).data("link")); }); } });