我正在尝试在 Bootstrap 模态中嵌入一个滑块,但它在模态框中不起作用,但是如果我将代码放在模态框之外,它可以正常工作。
这是我的代码
<div class="modal fade bs-example-modal-lg" id="frown_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="content-box-large pull-left col-md-12">
<div class="modal-body">
<div class="col-md-12">
<div class="row">
<h4>Rate <span class="friends_name"></span></h4>
</div>
<hr/>
<input type="hidden" name="rated_value" class="rated_value" value="" />
<input type="hidden" name="friends_id" class="friends_id" value="" />
<div class="col-lg-12">
<input type="text" class="span2 slider" value="" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="0" data-slider-orientation="horizontal" data-slider-selection="after" data-slider-tooltip="hide" />
</div>
<div class="col-lg-12">
<img src="" class="friends_img" width="320" height="240" />
</div>
<a class="btn btn-primary pull-center send_ajax_btn" id="submit_btn" href="javascript:void(0);">Save</a>
<a class="btn btn-primary pull-center delete_no" id="close_popup" href="javascript:void(0);">Cancel</a>
</div>
</div>
</div>
</div>
</div>
这是Jquery
$(".slider").slider();
提前致谢。