Javascript 在jquery事件之后转到href
下面的代码是我正在运行的JS,用于创建手风琴风格的侧菜单。类别类嵌套在group类中,group类嵌套在section类中。在向上或向下滑动事件之后,如何更改此JS以转到href?我需要来自html的hrefJavascript 在jquery事件之后转到href,javascript,jquery,html,Javascript,Jquery,Html,下面的代码是我正在运行的JS,用于创建手风琴风格的侧菜单。类别类嵌套在group类中,group类嵌套在section类中。在向上或向下滑动事件之后,如何更改此JS以转到href?我需要来自html的href (function ($) { $(document).ready(function () { var activeElement = $('#cssmenu').find('.active'); activeElement.parentsUntil
(function ($) {
$(document).ready(function () {
var activeElement = $('#cssmenu').find('.active');
activeElement.parentsUntil(".section").show();
$('.section > a').click(function () {
$('#cssmenu li').removeClass('active');
$(this).closest('li').addClass('active');
var checkElement = $(this).next();
if ((checkElement.is('.group-list')) && (checkElement.is(':visible'))) {
$(this).closest('li').removeClass('active');
checkElement.slideUp('normal');
}
if ((checkElement.is('.group-list')) && (!checkElement.is(':visible'))) {
$('.group-list:visible').slideUp('normal');
$('.category-list:visible').slideUp('normal');
checkElement.slideDown('normal');
}
if ($(this).closest('li').find('ul').children().length == 0) {
return true;
} else {
return false;
}
});
$('.group > a').click(function (e) {
$('#cssmenu li').removeClass('active');
$(this).closest('li').addClass('active');
var checkElement = $(this).next();
if ((checkElement.is('.category-list')) && (checkElement.is(':visible'))) {
$(this).closest('li').removeClass('active');
checkElement.slideUp('normal');
}
if ((checkElement.is('.category-list')) && (!checkElement.is(':visible'))) {
$('.category-list:visible').slideUp('normal');
checkElement.slideDown('normal');
}
if ($(this).closest('li').find('ul').children().length == 0) {
return true;
} else {
return false;
}
window.location.href = $(this).attr('href');
});
$('.category > a').click(function () {
$('#cssmenu li').removeClass('active');
$(this).closest('li').addClass('active');
var checkElement = $(this).next();
if ((checkElement.is('.category-list')) && (checkElement.is(':visible'))) {
$(this).closest('li').removeClass('active');
}
if ($(this).closest('li').find('ul').children().length == 0) {
return true;
} else {
return false;
}
window.location.href = $(this).attr('href');
});
});
})(jQuery);
jQuery(和slideDown)事件接受一个回调函数,该函数在动画完成后执行。然后,您可以使用scrollIntoView()或任何您想要的工具。jQuery的(和slideDown)事件接受一个回调函数,该函数在动画完成后执行。然后,您可以使用scrollIntoView()或任何您想要的工具。jQuery的(和slideDown)事件接受一个回调函数,该函数在动画完成后执行。然后,您可以使用scrollIntoView()或任何您想要的工具。jQuery的(和slideDown)事件接受一个回调函数,该函数在动画完成后执行。然后您可以使用scrollIntoView()或任何您想要的方法。jQuery的
slideUp
和slideDown
方法接受回调:
例如:
$('.group > a').click(function() {
var checkElement = $(this).next();
var href = $(this).attr('href');
checkElement.slideUp('normal', function() {
window.location.href = href;
});
});
jQuery的
slideUp
和slideDown
方法接受回调:
例如:
$('.group > a').click(function() {
var checkElement = $(this).next();
var href = $(this).attr('href');
checkElement.slideUp('normal', function() {
window.location.href = href;
});
});
jQuery的
slideUp
和slideDown
方法接受回调:
例如:
$('.group > a').click(function() {
var checkElement = $(this).next();
var href = $(this).attr('href');
checkElement.slideUp('normal', function() {
window.location.href = href;
});
});
jQuery的
slideUp
和slideDown
方法接受回调:
例如:
$('.group > a').click(function() {
var checkElement = $(this).next();
var href = $(this).attr('href');
checkElement.slideUp('normal', function() {
window.location.href = href;
});
});
移动您的
窗口。位置
,使其位于if语句中幻灯片的旁边?嗯。。。那起作用了。。。相当愚蠢的问题。。。由于退货,我没有到达窗口。位置线。。。FacePalm移动你的窗口。位置
,使其位于if语句中幻灯片的旁边?嗯。。。那起作用了。。。相当愚蠢的问题。。。由于退货,我没有到达窗口。位置线。。。FacePalm移动你的窗口。位置
,使其位于if语句中幻灯片的旁边?嗯。。。那起作用了。。。相当愚蠢的问题。。。由于退货,我没有到达窗口。位置线。。。FacePalm移动你的窗口。位置
,使其位于if语句中幻灯片的旁边?嗯。。。那起作用了。。。相当愚蠢的问题。。。由于退货,我没有到达窗口。位置线。。。掌纹