gpt4 book ai didi

javascript - 如何在jquery中写一个函数

转载 作者:行者123 更新时间:2023-11-29 16:15:10 24 4
gpt4 key购买 nike

<分区>

伙计们,实际上我想尽快编写这段代码,而不是分别为我的所有 4 个元素重写相同的代码,我想编写一个将为每个元素调用并执行的函数。

$(function(){
$('#basic').mouseover(function(){
$('#table-one').css({ boxShadow : "0 0 5px 3px rgba(100,100,200,0.4)" });
});
$('#basic').mouseout(function(){
$('#table-one').css({ boxShadow : "0 0 0 0" });
});

});

$(function(){
$('#standard').mouseover(function(){
$('#table-two').css({ boxShadow : "0 0 5px 3px rgba(100,100,200,0.4)" });
});
$('#standard').mouseout(function(){
$('#table-two').css({ boxShadow : "0 0 0 0" });
});

});

$(function(){
$('#pro').mouseover(function(){
$('#table-three').css({ boxShadow : "0 0 5px 3px rgba(100,100,200,0.4)" });
});
$('#pro').mouseout(function(){
$('#table-three').css({ boxShadow : "0 0 0 0" });
});

});

$(function(){
$('#expert').mouseover(function(){
$('#table-four').css({ boxShadow : "0 0 5px 3px rgba(100,100,200,0.4)" });
});
$('#expert').mouseout(function(){
$('#table-four').css({ boxShadow : "0 0 0 0" });
});

});

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