0
我有一個鏈接到導航欄的Jquery toggle()函數。當用戶點擊切換按鈕時,它會在導航欄下顯示新內容。我已經對導航欄和切換類應用了一個邊框底部。我希望這個邊框在擴展時跟隨切換。這可能嗎?Jquery toggle()按照導航欄引導的邊框
我做了一個Bootply來進一步解釋我的觀點。
下面是我的Jquery
jQuery(document).ready(function($) {
$banner = $(".banner");
$banner.hide();
$(".show-banner").on("click", function() {
if ($(".banner").is(":hidden")) {
$("nav.navbar.navbar-inverse").attr('style', 'border-bottom: border-bottom:4px solid #ff0000;!important').delay(5000);
} else {
$("nav.navbar.navbar-inverse").attr('style', 'border-bottom: border-bottom:4px solid #ff0000; !important').delay(5000);
}
$banner.slideToggle()
$(".navbar-collapse.collapse").addClass("hide-all");
});
});
非常感謝你:) – user1673498
不客氣! – Ren
預計它不能在我的網站上工作xD – user1673498