gpt4 book ai didi

jquery - onClick不显示div

转载 作者:太空宇宙 更新时间:2023-11-04 00:07:25 25 4
gpt4 key购买 nike

我的 jquery 没有在 http://jsfiddle.net/jspence29/a3BQR/1/ 显示我想要的 div

我希望大 div 在您单击按钮时出现并在您再次单击时消失,但它就是没有出现。谢谢

此外,使用 css 更改 jquery 或仅此显示和隐藏查询更推荐什么?

$(".first1").onClick(
function () {
$('#suitsyou').show();
},
function ()
$('#suitsyou').hide();
});

或者类似的东西

$("div").click(function () {
var color = $(this).css("background-color");
$("#result").html("That div is <span style='color:" +
color + ";'>" + color + "</span>.");
});

最佳答案

尝试 toggle

$(".first1").on('click', 
function () {
$('#suitsyou').toggle();
});
$(".last1").on('click',
function () {
$('#dealsandoffers').toggle()
});

关于jquery - onClick不显示div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14401184/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com