Выберите элемент из родных элементов

0

У меня есть 4 элемента формы ввода, которые я хочу выбрать из входных братьев, значение которых изменено (готово к загрузке). Но мой синтаксис не работает:

HTML:

<div style="overflow:hidden; position: relative; display: inline-block;" class="fileinput-wrapper">
    <div style="background:url(http://localhost/project/assets/images/ajax-loader.gif) no-repeat center center" data-provides="fileinput" class="fileinput fileinput-new">
        <div style="width: 200px; height: 130px;background:url(http://localhost/project/assets/images/upload_a_photo.png) no-repeat center center" data-trigger="fileinput" class="fileinput-preview thumbnail">
        </div>
    </div>
    <input type="file" name="photos[]" tabindex="-1" style="opacity: 0; position: absolute; z-index: -1; left: -367.5px; top: 80.9333px;">
</div>

JS:

$("input[type=file]").on('change',function(){
    $(this).siblings('.fileinput-preview').css('background','');
});
Теги:
upload

2 ответа

2
Лучший ответ
$("input[type=file]").on('change',function(){
    $(this).parents('.fileinput-wrapper').find('.fileinput-preview').css('background','none');
});
  • 0
    спасибо, ваш прав.
  • 0
    Отлично. Пожалуйста, примите ответ.
0

попробуй это

$(this).next('.fileinput-preview').css('background','none');

Ещё вопросы

Сообщество Overcoder
Наверх
Меню