![](/img/trans.png)
[英]How can I get one button to reveal different hidden divs with each click?
[英]How can I have the click of one button activate 2 divs in different ways with JQuery?
例如:
我是 Javascript/JQuery 的新手,所以任何幫助都會很棒! 謝謝。
$(document).ready(function() {
$(".bookBox-1").click(function() {
$(".main-title").slideUp("slow");
});
$(".bookBox-1").click(function() {
$(".bookDescriptions-kinkyKenny").slideDown();
});
});
.bookDescriptions-kinkyKenny,
.bookDescriptions-eatWhatYoureGiven {
position: absolute;
width: 1778px;
height: 423px;
top: 144px;
left: 0;
display: none;
}
.bookDescription-1,
.bookDescription-2 {
position: relative;
height: inherit;
width: inherit;
display: flex;
align-items: center;
justify-content: center;
}
.main-title {
font: 100 125px 'Josefin Sans', sans-serif;
position: relative;
left: 151px;
}
function myfunc1() {
$(".main-title").slideUp("slow");
$(".bookDescriptions-kinkyKenny").slideDown();
$(".bookBox-1").unbind("click", myfunc1);
$(".bookBox-1").click(myfunc2);
}
function myfunc2() {
$(".bookDescriptions-kinkyKenny").slideUp("slow");
$(".main-title").slideDown();
$(".bookBox-1").unbind("click", myfunc2);
$(".bookBox-1").click(myfunc1);
}
$(document).ready(function() {
$(".bookBox-1").click(myfunc1);
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.