From cc0d794cd663666f5774504d9674893601dbd1aa Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Thu, 13 May 2010 21:51:24 +0000 Subject: Basic javascript for image area tagging function. This needs to be combined with mimetaggedimage plugin --- scripts/imagetag.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scripts/imagetag.js diff --git a/scripts/imagetag.js b/scripts/imagetag.js new file mode 100644 index 0000000..20c658e --- /dev/null +++ b/scripts/imagetag.js @@ -0,0 +1,28 @@ +function updateForm(){ + $("#width").val($("#drag").attr("offsetWidth")); + $("#height").val($("#drag").attr("offsetHeight")); + $("#top").val($("#drag").attr("offsetTop")); + $("#left").val($("#drag").attr("offsetLeft")); +} +$(document).ready(function(){ + updateForm(); + $("#drag").resizable({ + stop: function() { + updateForm(); + } + }); + $("#drag").draggable({ + containment: 'parent', + stop: function() { + updateForm(); + } + }); + $(".tag").hover( + function () { + $(this).addClass("tagOn"); + }, + function () { + $(this).removeClass("tagOn"); + } + ); +}); \ No newline at end of file -- cgit v1.3