jquery - Alternative to :last selector to select the correct div -
I have several disks that are generated dynamically after uploading the file. I upload each file to a div in this format Makes:
& lt; Div id = "uploadifive-fileupload-queue" class = "uploadifive-queue" & gt; & Lt; Div class = "uploadifive-queue-item full" id = "uploadifive-fileupload-file-0" & gt; & Lt; Div id = "input" & gt; Some text & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; Upload the item to the uploadifive-queue-item class of uploadifive-fileupload-file-0, uploadifive-fileupload-file-1, uploadifive-fileupload-file-2 Increased rise, etc.
What am I trying to do that adds a class to #inputs , but only one has been created. I can do it using: The last time I only upload one time at a time, but if I select multiple at the same time, then it is only in that group The last final applies to the deal.
What I see is like this $) or one way to target that unique uploader ({'buttonclass':' btn btn-primary ',' button text ':' thumbnail 'Upload' script: './upload/', 'onUploadComplete': function (file, 'file'), 'fileSizeLimit': 1000, 'method': 'post', 'simupload limit': 1, Data) {$ ("# uploadifive-fileupload-queue .uploadifive -quote-item: last"). ('# Input'). AddClass ('warning-error');}});
#fileupload is the name of the form only, here is HTML: & Lt; / Form & gt; Divs are directly given below and are in the same container.
How do I choose the right div? Part of the problem is duplicate IDs, try to change them to class names or unique values.
The second part is that:
$ ("# uploadifive-fileupload-queue .uploadifive-queue-item: last") ... First , select the last (and only) .uploadifive-queue-item in the unique # uploadifive-fileupload-queue Element: Then there are cheat codes and wrong selector problems. Instead, replace it with id = "inputs" to class = "inputs" and use it: $ (". Uploadifive- Queue: last input. "). AddClass ('warning-error'); ... and make sure to fix the rest of those duplicate IDs.
Even with the secret ID, if you have the right selector, rely on t.
Comments
Post a Comment