我收到错误:
body.scrollTop在严格模式下已弃用.如果处于严格模式,请使用'documentElement.scrollTop';如果处于怪癖模式,请使用'body.scrollTop'.
我的代码是:
$(document).ready(function(){
//Animates Scrolling to anchor
function scrollToAnchor(aid){
var divTag = $("div[name='"+ aid +"']");
$('html,body').animate({scrollTop: divTag.offset().top},'slow');
}
//If Checking out as guest, scroll to Shipping Information
$("#ReadDescription").click(function() {
scrollToAnchor('longdescreadmore');
});
});
Run Code Online (Sandbox Code Playgroud)
如何编辑我的代码以使用此documentElement.ScrollTop?
如果我不想在底部有盒子阴影,我该如何将CSS更改为?
我正在使用它,但我<sections>
的部分底部有一个阴影.我不希望这样,所以我只想在底部摆脱阴影.
目前的CSS是:
-webkit-box-shadow: 0 5px 19px 2px rgba(0,0,0,0.1);
-moz-box-shadow: 0 5px 19px 2px rgba(0,0,0,0.1);
box-shadow: 0 5px 19px 2px rgba(0,0,0,0.1);
Run Code Online (Sandbox Code Playgroud) 如何将类添加到li
已分配给它的类的现有类中?
我目前的代码是 http://jsfiddle.net/GbPdV/
我想将"Open"类添加到:
< li class="dropdown hover carticon cart" >
Run Code Online (Sandbox Code Playgroud)
我想这必须发生在:(不确定)
if ( response.Status == "Success" )
{
$.ajax({
type: "GET",
url: "dmiajax.aspx?request=FloatingCart&extra=" + rnd(),
dataType: "html",
success: function(response) {
var floatingCart = $("ul.dropdown-menu.topcart");
if (floatingCart.length == 0) {
floatingCart = $('<ul class="dropdown-menu topcartopen"></ul>').insertBefore(".pull-right");
floatingCart.hoverIntent({
over: function() {},
timeout: 200,
out: function() {
$(this).stop(true, true).filter(":visible").hide("drop", {
direction: "down"
});
}
});
}
Run Code Online (Sandbox Code Playgroud) 但是当我点击提交时它没有被触发.它提交但不做任何事情.有任何想法吗?警报甚至没有被调用:(
我正在执行此操作的页面是我的Checkout页面:
http://rsatestamls.kaliocommerce.com
(需要购物车中的商品才能结帐)
我的Javascript代码是:
<script>
$(document).ready(function () {
$("#Method input:checkbox").change(function () {
if (this.checked) {
var checkname = $(this).attr("name");
$('input[type=checkbox][id=OnAccount]').prop('value', 'True')
$("input:checkbox[name='" + checkname + "']").not(this).removeAttr("checked");
} else {
$('input[type=checkbox][id=OnAccount]').val('No');
}
});
$("#CheckoutOptions input:checkbox").change(function () {
if (this.checked) {
var checkname = $(this).attr("name");
$("input:checkbox[name='" + checkname + "']").not(this).removeAttr("checked");
}
});
});
$("#CheckOut").submit(function (event) {
alert("Handler for .submit() called.");
jQuery.validator.setDefaults({
debug: false,
success: "valid"
});
$("#CheckOut").validate({
rules: {
FirstName: {
required: true
},
LastName: {
required: true
},
Email: { …
Run Code Online (Sandbox Code Playgroud)