我使用bx滑块在我的nodejs网站上运行滑块.这是我的代码:
$(document).ready(function(){
$(".bxslider").bxSlider({
minSlides: 1,
maxSlides: 40,
slideWidth: 300,
slideMargin: 40,
moveSlides: 1
});
});//document ready
Run Code Online (Sandbox Code Playgroud)
由于滑块需要100%流体宽度,我设置maxSlides为足够大的数字(此处为40).这使滑块以流动的方式扩展到整个宽度.但现在的问题是,由于滑块宽度是流动的,在某些宽度处,最右边的可见滑块仅部分显示.我想要它显示这个完整的幻灯片,或者如果它在当前视口中不完全可见则保留它.
我没有用过Form元素.我没有使用表格,因为,我不想回发..请指导我如何做ajax调用所以,能够得到$ .ajax将viewmodel发布到控制器的动作方法?我的表格如下:
HTML:
@model comp.learn.data.Models.ProductViewModel
@{
ViewBag.Title = "Create";
}
<h2>Create</h2>
<fieldset>
<legend>ProductViewModel</legend>
<div id="CreateDiv">
<div class="editor-label">
@Html.LabelFor(model => model.ProductName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.ProductName)
@Html.ValidationMessageFor(model => model.ProductName)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Cost)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Cost)
@Html.ValidationMessageFor(model => model.Cost)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Description)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Description)
@Html.ValidationMessageFor(model => model.Description)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.ProductTypeId)
</div>
<div class="editor-field">
@Html.DropDownList("ProductTypeId", "Choose item")
@Html.ValidationMessageFor(model => model.ProductTypeId)
</div>
<div class="editor-label">
@Html.LabelFor(model …Run Code Online (Sandbox Code Playgroud)