我尝试使用jQuery设置body标记的背景动画:
I try to animate the background of the body tag using jQuery:
因此,我添加了jQuery And jQuery UI CDN和以下代码:
So I've added the jQuery And jQuery UI CDNs and the code below:
$("body").animate({ backgroundColor: '#32a852' }, 1500);该代码在JSFiddle中运行良好,但是当我尝试在自己的代码中使用它时,没有任何改变!
The code works fine in JSFiddle But when I try to use it in my own code nothing changes!
这是我的身体标签:
<body style="background: rgb(253, 253, 253);" class="cs-HTML is-theme-classic is-desktop" role="application"></body>我认为上述body标签中的背景色可能会导致问题,也许我们需要以某种方式覆盖它...
I think maybe the background color in the above body tag causes the problem and maybe we need to override this in some way...
我很困惑,请帮助...
I'm confused please help...
推荐答案我添加了一个jsfiddle,您应该将您的样式带到CSS上,然后重试,并且您应该确保主体是完整的高度和宽度,并且没有覆盖div已满身体上
I added one jsfiddle u should take yout style to css and try again and u should be sure that body is full height and width and there is no override div full on body
jsfiddle/9ycz5kus/2/
<body class="cs-HTML is-theme-classic is-desktop" role="application"></body> $("body").animate({backgroundColor: 'blue'},1500); .cs-HTML { background: rgb(253, 253, 253); }
更多推荐
使用jQuery动画覆盖body标签的背景色
发布评论