Note that there are some explanatory texts on larger screens.

plurals
  1. POHide changed select
    primarykey
    data
    text
    <p>I have a table with 3 row and 3 selectboxes in each of them. On change I want to hide the selectbox, insert a small loader image for 250 ms and then show the selectbox with the selected option. Ex. if I select "completed" in row1, hide the select only in row1, insert the loader image, and then show the selectbox with "completed" as selected( add attribute selected="selected to the option"). Here is my demo: <a href="http://jsfiddle.net/5ueYw/1/" rel="nofollow">http://jsfiddle.net/5ueYw/1/</a> and what have I got so far. Who can give some tips? Thanks</p> <p>HTML:</p> <pre><code>&lt;table id="inbTB"&gt; &lt;thead&gt; &lt;tr class="head"&gt; &lt;th class="sortH alignCenter smSelN header"&gt;#&lt;/th&gt; &lt;th class="sortH alignLeft header headerWidth " nowrap="nowrap"&gt;Name&lt;/th&gt; &lt;th class="sortH alignLeft header smSelR"&gt;&lt;tag:lang.stats /&gt;Status&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr class="sortRow"&gt; &lt;td class="alignCenter"&gt;#1&lt;/td&gt; &lt;td class="alignLeft upCase"&gt;One&lt;/td&gt; &lt;td class="alignCenter"&gt; &lt;select class="stSel smSelR smSelRInput"&gt; &lt;option value="0"&gt;New&lt;/option&gt; &lt;option value="1"&gt;Completed&lt;/option&gt; &lt;option value="2"&gt;Canceled&lt;/option&gt; &lt;/select&gt; &lt;div class="loader"&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr class="sortRow"&gt; &lt;td class="alignCenter"&gt;#2&lt;/td&gt; &lt;td class="alignLeft upCase"&gt;Two&lt;/td&gt; &lt;td class="alignCenter"&gt; &lt;select class="stSel smSelR smSelRInput"&gt; &lt;option value="0"&gt;New&lt;/option&gt; &lt;option value="1"&gt;Completed&lt;/option&gt; &lt;option value="2"&gt;Canceled&lt;/option&gt; &lt;/select&gt; &lt;div class="loader"&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr class="sortRow"&gt; &lt;td class="alignCenter"&gt;#3&lt;/td&gt; &lt;td class="alignLeft upCase"&gt;Three&lt;/td&gt; &lt;td class="alignCenter"&gt; &lt;select class="stSel smSelR smSelRInput"&gt; &lt;option value="0"&gt;New&lt;/option&gt; &lt;option value="1"&gt;Completed&lt;/option&gt; &lt;option value="2"&gt;Canceled&lt;/option&gt; &lt;/select&gt; &lt;div class="loader"&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p> </p> <p>JQUERY:</p> <pre><code> var gif = $('.alignCenter .loader'); $('.stSel').change(function(){ $('select').hide(); gif.html('&lt;img alt="" src="" /&gt;').show().delay(250).fadeOut(function(){ // src image is a loader gif $('.stSel option selected').show(); }); }) </code></pre>
    singulars
    1. This table or related slice is empty.
    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. 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