From cf030b62c79fc15bcd8802974f6757a37e85deea Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 26 Jun 2011 02:49:04 +0530 Subject: [PATCH] added ids to elements, some console.log testing to identify elements on mouse-over --- index.html | 50 +++++++++++++++++++++++++------------------------- radia.js | 14 ++++++++++++++ 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/index.html b/index.html index 8e064ce..6947698 100644 --- a/index.html +++ b/index.html @@ -21,19 +21,19 @@ - + - + - + - + @@ -57,7 +57,7 @@ Content - + @@ -96,7 +96,7 @@ - + @@ -105,12 +105,12 @@ - + - + @@ -118,44 +118,44 @@ - + - + - + - + - + - + - + - + - + @@ -172,7 +172,7 @@ Rashmi - + @@ -195,7 +195,7 @@ Kanimozhi - + @@ -242,7 +242,7 @@ K.R. Raja - + TATA @@ -292,7 +292,7 @@ Ratan Tata - + @@ -321,7 +321,7 @@ Upender - + @@ -346,7 +346,7 @@ Iron Ore - + @@ -359,7 +359,7 @@ Rajathi Ammal - + @@ -382,7 +382,7 @@ R.K.Chandolia - + diff --git a/radia.js b/radia.js index 879b96e..e801a00 100644 --- a/radia.js +++ b/radia.js @@ -14,6 +14,20 @@ $(function() { $.getJSON("radia.json", {}, function(data) { var R = data; var $texts = []; + $('g').each(function() { + // console.log("hi"); + if (typeof($(this).attr("id")) === 'undefined') { + return; + } + + $(this).click(function() { + console.log($(this).attr("id")); + }); + $(this).mouseover(function() { + console.log($(this).attr("id")); + }); + }); + $('text').each(function() { $(this).css({'cursor': 'pointer'}); var $tspan = $(this).children('tspan').eq(0);