My Blog

Archive for the ‘jQuery’ Category

Simple JQuery slide show

Friday, March 27th, 2009

For example you have couple of photos with this html

 <div id="photos">
  <ul>
         <li><img src="/img/1.jpg" /></li>
         <li><img src="/img/2.jpg" /></li>
         <li><img src="/img/3.jpg" /></li>
         <li><img src="/img/4.jpg" /></li>
         <li><img src="/img/5.jpg" /></li>
         <!– any count you want –>
  </ul>

(more…)

Multiple File Upload plugin for jQuery and Cancel button

Thursday, November 20th, 2008

QuocKien here ask me to help him with Multiple File Upload plugin and cancel button

This the most easy way I think

it’s this simple js code (cancel button will work for second multi input file)

$(document).ready(function(){
        $(’.multi’).MultiFile();
        $(’.multi2′).MultiFile();
       

         $("#cancel_but").click(function() {
            $(".multi2").parent().find(’span a’).each(function() {
                $(this).click();
            });
        })

});

where is .multi2 - it’s selector of your multi file input

simple html

<input type="file" class="multi" />
<input type="file" class="multi2" /><input type="button" value="cancel" id="cancel_but" />

 

I hope this help