<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thanks a million, that solved the problem (I feel a little silly
overlooking that one).<o:p></o:p></span>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>:-)<o:p></o:p></span>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>JK<o:p></o:p></span>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
jquery-dev@googlegroups.com [mailto:jquery-dev@googlegroups.com] <b>On Behalf
Of </b>John Resig
<b>Sent:</b> Wednesday, July 15, 2009 1:41 PM
<b>To:</b>
jquery-dev@googlegroups.com<b>Subject:</b> [jquery-dev] Re: Help with jQuery.event.trigger<o:p></o:p></span>
</div>
<p class=MsoNormal><o:p> </o:p>
<p class=MsoNormal style='margin-bottom:12.0pt'>Why not make sure that the
e.target is equal to the active element before re-firing the event?
if ( e.target === this ) {
// your code
}
<br clear=all>
--John
<o:p></o:p>
<div>
<p class=MsoNormal>On Wed, Jul 15, 2009 at 3:39 PM, Jeffrey Kretz <<a
href="mailto:jeffkretz@hotmail.com">
jeffkretz@hotmail.com</a>> wrote:<o:p></o:p>
<p class=MsoNormal>
I hate to bump this, but I haven't yet been able to figure out a solution --
I'm hoping someone knows of a way to accomplish this result.
Thanks,
<span style='color:#888888'>JK</span><o:p></o:p>
<div>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'>
-----Original Message-----
From: <a href="mailto:jquery-dev@googlegroups.com">
jquery-dev@googlegroups.com</a>
[mailto:<a href="mailto:jquery-dev@googlegroups.com">
jquery-dev@googlegroups.com</a>]
On
Behalf Of Jeffrey Kretz
Sent: Tuesday, July 14, 2009 7:12 PM
To: <a href="mailto:jquery-dev@googlegroups.com">
jquery-dev@googlegroups.com</a>
Subject: [jquery-dev] Help with jQuery.event.trigger
I'm posting this to the dev list in hopes that someone here may know of a
better pattern for what I'm trying to do. A change with the
jQuery.event.trigger method (between 1.2.x and 1.3.x) has affected a plugin
I wrote, and I'm trying to find a solution.
----------------------------------------
I have a custom color picker which has broken since I upgraded from 1.2.6 to
1.3.2.
I've traced the problem to a change in how events are bubbled. There's
probably an easy fix, but I'm not sure what it would be.
I have a hue slider with a hue indicator inside it. The indicator is a
draggable, and the hue updates on drag. That works fine.
The slider itself has a mousedown event that moves the hue indicator the
clicked position. This also works fine.
The slider (parent) mousedown event then triggers the indicator (child)
mousedown event. This is what is broken. What I'm trying to do, is
when
the user does a mousedown on the slider, I want the indicator to not only
move to that position, but be draggable immediately without having to
release the mouse and click on the same spot.
The specific problem is this:
1. The slider triggers the mousedown event on the indicator.
2. The indicator draggable initializes.
3. The indicator's mousedown.draggable event does not cancel propagation.
4. The jQuery trigger event then bubbles up to the parent (the slider).
5. Which then re-fires the indicator mousedown event.
6. Infinite loop.
It seems that there must be a better pattern that allows me to trigger the
child element's draggable without causing this loop.
Does anyone have any suggestions?
JK
<o:p></o:p>
</div>
</div>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'>
</div>