Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your code for changing the options works fine. It seems IE8 isn't handling a "fast" second-click with the <code>click</code> event but rather expects a <code>double click</code> to be handled.</p> <p>Using my test code below, you'll notice that in IE8 writes out the following when <code>Move Down/Up</code> is pressed "fast":</p> <pre><code>Move Down Click Move Down Double-Click Move Down Click Move Down Double-Click </code></pre> <p>But with FF/Chrome the following is printed:</p> <pre><code>Move Down Click Move Down Click Move Down Double-Click Move Down Click Move Down Click Move Down Double-Click </code></pre> <p>Here's the code I'm using to test. I haven't done any tests to see if it's jQuery's event binders that are causing the issues. </p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Test&lt;/title&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;select id="list" multiple="multiple"&gt; &lt;option value="option1"&gt;Option 1&lt;/option&gt; &lt;option value="option2"&gt;Option 2&lt;/option&gt; &lt;option value="option3"&gt;Option 3&lt;/option&gt; &lt;/select&gt; &lt;button id="mup"&gt;Move Up&lt;/button&gt; &lt;button id="mdown"&gt;Move Down&lt;/button&gt; &lt;script type="text/javascript"&gt; var $DEBUG = null; $(document).ready(function () { $DEBUG = $("#debug"); $DEBUG.append("Registering Events&lt;br /&gt;"); $("#mup").click(moveUpItem); $("#mdown").click(moveDownItem); $("#mup").bind("dblclick", function () { $DEBUG.append("Move Up Double-Click&lt;br /&gt;"); }); $("#mdown").bind("dblclick", function () { $DEBUG.append("Move Down Double-Click&lt;br /&gt;"); }); }); function moveUpItem() { $DEBUG.append("Move Up Click&lt;br /&gt;"); } function moveDownItem() { $DEBUG.append("Move Down Click&lt;br /&gt;"); } &lt;/script&gt; &lt;div id="debug" style="border: 1px solid red"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>EDIT:</strong> I can confirm <em>it is</em> IE8 that is the problem. Swap this IE8-specific code in the $(document).ready() handler:</p> <pre><code>// $("#mup").click(moveUpItem); $("#mup")[0].attachEvent("onclick", moveUpItem); // $("#mdown").click(moveDownItem); $("#mdown")[0].attachEvent("onclick", moveUpItem); // $("#mup").bind("dblclick", function () $("#mup")[0].attachEvent("ondblclick", function () { $DEBUG.append("Move Up Double-Click&lt;br /&gt;"); }); // $("#mdown").bind("dblclick", function () $("#mdown")[0].attachEvent("ondblclick", function () { $DEBUG.append("Move Down Double-Click&lt;br /&gt;"); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload