gpt4 book ai didi

jquery - removeAttr ("style") 和 attr ("style","") 不起作用

转载 作者:行者123 更新时间:2023-12-01 05:57:58 30 4
gpt4 key购买 nike

http://synergine.net/rain.php

你好。我试图清除 .ripple div 中所有元素的样式属性,但没有成功:

function contact(level){
focus_ripple = Math.floor(Math.random() * 100) + 1;
$("#"+level+" .ripple"+focus_ripple+" p").css("opacity",1);
$("#"+level+" .ripple"+focus_ripple+" .fourth").animate({
height: "324px",
width: "324px",
top: "-162px",
left: "-162px",
"border-radius": "162px"
},{duration: 1000, queue: false});
$("#"+level+" .ripple"+focus_ripple+" .third").animate({
height: "108px",
width: "108px",
top: "-54px",
left: "-54px",
"border-radius": "54px"
},{duration: 1000, queue: false});
$("#"+level+" .ripple"+focus_ripple+" .second").animate({
height: "32px",
width: "32px",
top: "-18px",
left: "-18px",
"border-radius": "18px"
},{duration: 1000, queue: false});
$("#"+level+" .ripple"+focus_ripple+" .first").animate({
height: "10px",
width: "10px",
top: "-6px",
left: "-6px",
"border-radius": "6px"
},{duration: 1000, queue: false});
$("#"+level+" .ripple"+focus_ripple+" p").animate({
opacity: 0
},{duration: 1550, queue: false});
setTimeout(function() {
$("#"+level+" .ripple"+focus_ripple+" p").removeAttr("style");
},1575);
counter++;

}

非常感谢您对此的任何帮助。谢谢。

最佳答案

removeAttr()在 1.7.2 上为我工作:

$("div").click(function(){
$(this).removeAttr("style");
})​

参见 fiddle :http://jsfiddle.net/adrianonantua/p5Dcs/

您必须确保您的选择器确实带来结果。

关于jquery - removeAttr ("style") 和 attr ("style","") 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13596231/

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