<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How To Enable Dragging in SVG</title>
	<atom:link href="http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/</link>
	<description></description>
	<lastBuildDate>Tue, 17 Jan 2012 21:56:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Marko Matic Cipi</title>
		<link>http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/comment-page-1/#comment-147345</link>
		<dc:creator>Marko Matic Cipi</dc:creator>
		<pubDate>Mon, 11 Apr 2011 10:22:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codedread.com/?p=194#comment-147345</guid>
		<description>DAAAAAMN!!! xD Works with jQuery SVG perfectly!!! THANX MAN! :D</description>
		<content:encoded><![CDATA[<p>DAAAAAMN!!! xD Works with jQuery SVG perfectly!!! THANX MAN! <img src='http://www.codedread.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Helder Magalhães</title>
		<link>http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/comment-page-1/#comment-290</link>
		<dc:creator>Helder Magalhães</dc:creator>
		<pubDate>Fri, 14 Mar 2008 10:24:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codedread.com/?p=194#comment-290</guid>
		<description>I&#039;ve just had a look and the implementation for getScreenCTM in ASV3 seems to work OK. :-) Kind of slow though... :-&#124;

Just a tip: that part of the code has no semicolons ending JS instructions. This may become an issue if someone runs a JS minifier on the script. ;-)</description>
		<content:encoded><![CDATA[<p>I&#8217;ve just had a look and the implementation for getScreenCTM in ASV3 seems to work OK. <img src='http://www.codedread.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Kind of slow though&#8230; :-&#124;</p>
<p>Just a tip: that part of the code has no semicolons ending JS instructions. This may become an issue if someone runs a JS minifier on the script. <img src='http://www.codedread.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/comment-page-1/#comment-289</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 08 Aug 2007 16:05:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codedread.com/?p=194#comment-289</guid>
		<description>I found out what I did wrong. I changed &quot;if (ball)&quot; in the init() function to &quot;if (evt.target == ball)&quot;... It&#039;s not the target anymore once the mouse pointer leaves it... got it :)</description>
		<content:encoded><![CDATA[<p>I found out what I did wrong. I changed &#8220;if (ball)&#8221; in the init() function to &#8220;if (evt.target == ball)&#8221;&#8230; It&#8217;s not the target anymore once the mouse pointer leaves it&#8230; got it <img src='http://www.codedread.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Schiller</title>
		<link>http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/comment-page-1/#comment-288</link>
		<dc:creator>Jeff Schiller</dc:creator>
		<pubDate>Wed, 25 Jul 2007 23:45:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codedread.com/?p=194#comment-288</guid>
		<description>Alex,

Thinking about it a little more - I may have updated the JavaScript dragging library many months after posting this article to use the technique I describe above of &quot;remembering&quot; the entity at the start of the drag...

Jeff</description>
		<content:encoded><![CDATA[<p>Alex,</p>
<p>Thinking about it a little more &#8211; I may have updated the JavaScript dragging library many months after posting this article to use the technique I describe above of &#8220;remembering&#8221; the entity at the start of the drag&#8230;</p>
<p>Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Schiller</title>
		<link>http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/comment-page-1/#comment-287</link>
		<dc:creator>Jeff Schiller</dc:creator>
		<pubDate>Wed, 25 Jul 2007 23:34:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codedread.com/?p=194#comment-287</guid>
		<description>Hi Alex,

I&#039;m glad you liked this tutorial - it&#039;s a little old now, but I&#039;m happy someone is lookign at it.

You pose an interesting question and I suppose the glib response would be that the SVG renderers need to get much faster.  What I did here though was upon mousedown is track the target (i.e. the entity that was clicked upon and then only clear that when mouseup occurs.  Then, during mousemove, if we&#039;ve been dragging an entity, we know exactly which one.  See the script that deals wtih the variable &quot;draggingElement&quot; in my code and where it gets set (the mousedown/mouseup event handlers).</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>I&#8217;m glad you liked this tutorial &#8211; it&#8217;s a little old now, but I&#8217;m happy someone is lookign at it.</p>
<p>You pose an interesting question and I suppose the glib response would be that the SVG renderers need to get much faster.  What I did here though was upon mousedown is track the target (i.e. the entity that was clicked upon and then only clear that when mouseup occurs.  Then, during mousemove, if we&#8217;ve been dragging an entity, we know exactly which one.  See the script that deals wtih the variable &#8220;draggingElement&#8221; in my code and where it gets set (the mousedown/mouseup event handlers).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/comment-page-1/#comment-286</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 25 Jul 2007 23:29:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codedread.com/?p=194#comment-286</guid>
		<description>Thank you for a great tutorial. I&#039;m just learning JavaScript, and this was very helpful. One question I have about these examples is, how do you make the dragged shapes follow the mouse pointer without &quot;falling off?&quot; For example, I have modified the code from your first example (which used a circle) to use a semi-opaque rect. When I drag the rect around, inevitably the mouse pointer leaves its perimeter, caused I assume by the SVG renderer being too slow to keep up with fast drags. The mouse pointer then &quot;loses&quot; the rect and I have to start the drag again, making sure to drag slowly or risk losing my &quot;grip&quot; on it. The shapes in your examples, by comparison, act like they are attached to the mouse pointer with rubber bands - which is ideal.</description>
		<content:encoded><![CDATA[<p>Thank you for a great tutorial. I&#8217;m just learning JavaScript, and this was very helpful. One question I have about these examples is, how do you make the dragged shapes follow the mouse pointer without &#8220;falling off?&#8221; For example, I have modified the code from your first example (which used a circle) to use a semi-opaque rect. When I drag the rect around, inevitably the mouse pointer leaves its perimeter, caused I assume by the SVG renderer being too slow to keep up with fast drags. The mouse pointer then &#8220;loses&#8221; the rect and I have to start the drag again, making sure to drag slowly or risk losing my &#8220;grip&#8221; on it. The shapes in your examples, by comparison, act like they are attached to the mouse pointer with rubber bands &#8211; which is ideal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Schiller</title>
		<link>http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/comment-page-1/#comment-285</link>
		<dc:creator>Jeff Schiller</dc:creator>
		<pubDate>Wed, 23 Aug 2006 21:01:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codedread.com/?p=194#comment-285</guid>
		<description>Ruud,

I don&#039;t have a lot of time right now but I might get around to this.  If you have some time, you can take the version at http://www.codedread.com/dragsvg.js (search for getScreenCTM function).  This was tweaked by Johan Sundstrom and myself.  Free to use and modify as long as you credit, no warranties, blah blah blah ;)

Regards,
Jeff</description>
		<content:encoded><![CDATA[<p>Ruud,</p>
<p>I don&#8217;t have a lot of time right now but I might get around to this.  If you have some time, you can take the version at <a href="http://www.codedread.com/dragsvg.js" rel="nofollow">http://www.codedread.com/dragsvg.js</a> (search for getScreenCTM function).  This was tweaked by Johan Sundstrom and myself.  Free to use and modify as long as you credit, no warranties, blah blah blah <img src='http://www.codedread.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Regards,<br />
Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Schiller</title>
		<link>http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/comment-page-1/#comment-284</link>
		<dc:creator>Jeff Schiller</dc:creator>
		<pubDate>Mon, 31 Jul 2006 16:48:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codedread.com/?p=194#comment-284</guid>
		<description>As I mentioned, the SVG DOM allows you to define your own attributes as you like on SVG entities.  As for a separate schema, well I guess you&#039;d have to start with the SVG DTD and add your stuff on top.  I&#039;m not familiar enough with DTD to say how easy this is though...</description>
		<content:encoded><![CDATA[<p>As I mentioned, the SVG DOM allows you to define your own attributes as you like on SVG entities.  As for a separate schema, well I guess you&#8217;d have to start with the SVG DTD and add your stuff on top.  I&#8217;m not familiar enough with DTD to say how easy this is though&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig</title>
		<link>http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/comment-page-1/#comment-283</link>
		<dc:creator>Craig</dc:creator>
		<pubDate>Mon, 31 Jul 2006 09:14:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codedread.com/?p=194#comment-283</guid>
		<description>Is it possible to define additional attributes in a seperate or extendede schema?

  Quote:

In using the above technique, it may be more proper to stick the dragx/dragy attributes into their own namespace (in which case I’d have to use getAttributeNS and setAttributeNS methods), but for the purposes of this demo it seems to work just fine. The reason for this is maybe because the SVG elements are in the SVG namespace but the attributes on those elements are in the null namespace.</description>
		<content:encoded><![CDATA[<p>Is it possible to define additional attributes in a seperate or extendede schema?</p>
<p>  Quote:</p>
<p>In using the above technique, it may be more proper to stick the dragx/dragy attributes into their own namespace (in which case I’d have to use getAttributeNS and setAttributeNS methods), but for the purposes of this demo it seems to work just fine. The reason for this is maybe because the SVG elements are in the SVG namespace but the attributes on those elements are in the null namespace.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jastarafie</title>
		<link>http://www.codedread.com/blog/archives/2005/12/21/how-to-enable-dragging-in-svg/comment-page-1/#comment-282</link>
		<dc:creator>jastarafie</dc:creator>
		<pubDate>Wed, 08 Mar 2006 17:18:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codedread.com/?p=194#comment-282</guid>
		<description>Hey there, great article... I used it for displaying the x and y position of the mouse when hovering over a .svg file.
The only thing that&#039;s not working fine, is  the performance. It takes up to 5 seconds to update the coordinates, and not smootly like your example.
I was wondering if you maybe know what the problem is?
I putted the .js code in seperate file, which is used by a .php file to generate the xml/svg.
Running apache2 + php5

Thanx in advance and sorry for the bad language...</description>
		<content:encoded><![CDATA[<p>Hey there, great article&#8230; I used it for displaying the x and y position of the mouse when hovering over a .svg file.<br />
The only thing that&#8217;s not working fine, is  the performance. It takes up to 5 seconds to update the coordinates, and not smootly like your example.<br />
I was wondering if you maybe know what the problem is?<br />
I putted the .js code in seperate file, which is used by a .php file to generate the xml/svg.<br />
Running apache2 + php5</p>
<p>Thanx in advance and sorry for the bad language&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

