![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 51 Pomógł: 0 Dołączył: 16.03.2009 Ostrzeżenie: (0%) ![]() ![]() |
Hej,
Korzystam z niewielkiego kodu w jQuery za pomocą, którego dodaję sobie dodatkowego file inputa. Czyli docelowo wyświetla się 1 file input z przyciskiem "dodaj kolejny", naciśnięcie tego przycisku dodaje drugiego file inputa. Problem polega na tym, że ten file input jest ostylowany za pomocą jQuery uniform - sexy forms (http://uniformjs.com/) i gdy się on dodaje to jest nieostylowany. Dlaczego tak się dzieje? Jak to można rozwiązać? Kod, który odpowiada za dodanie file inputa: CODE var scntDiv = $('#p_scents');
var i = $('#p_scents p').size() + 1; $('#addScnt').live('click', function() { $('<p><label for="p_scnts"><input type="file" class="fileInput" id="p_scnt" name="p_scnt_' + i +'" /></label> <a href="#" id="remScnt">Usuń</a></p>').appendTo(scntDiv); i++; return false; }); $('#remScnt').live('click', function() { if( i > 2 ) { $(this).parents('p').remove(); i--; } return false; }); $('#addScnt').live('click', function() { if( i > 3 ) { $('#addScnt').addClass('disabled-input'); } return false; }); $('#remScnt').live('click', function() { $('#addScnt').removeClass('disabled-input'); return false; }); |
|
|
![]() ![]() |
![]() |
Aktualny czas: 19.08.2025 - 18:17 |