jQuery的动画色彩间歇喷出属性值无效 [英] jquery color animation throws Invalid property value intermittently

查看:233
本文介绍了jQuery的动画色彩间歇喷出属性值无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图动画背景的ASP.Net超链接上做一个更新面板刷新黄色淡出。到目前为止,它的工作原理几乎所有的时间,但偶尔一个JavaScript错误时抛出无效的属性格式的价值。并调试到jQuery的彩色插件code到这一行...

I'm trying to animate the background for an ASP.Net hyperlink to do a yellow fade on an update panels refresh. So far it works almost all of the time, but occasionally a javascript error is thrown "Invalid Propery value." and it debugs into the jquery color plug-in code to this line...

fx.elem.style[attr] = "rgb(" + [
     Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
     Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
     Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
].join(",") + ")";

下面是活动的,因为他们目前正在发生的顺序...

Here is the order of events as they are currently happening...

首先,窗口加载等doc.ready它注册一个事件进行时更新面板已完成清爽像这样...

First, the window loads so on doc.ready it registers an event to be carried out when the update panel has finished refreshing like so...

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(yellowFade);

在哪里yellowFade被定义为...

Where yellowFade is defined as...

function yellowFade() {
    window.setTimeout("$('#' + hyperlinkUrlId).animate( { backgroundColor: 'white' }, 2000)", 2000);
    window.clearTimeout();
}

现在,很少我已经是正确的崩溃,在这一点上,但通常它后来的,所以我会继续...

Now, rarely I've had it crash right at this point but typically it is later, so I'll continue...

我然后点击标题为生成,创建一个URL加载ASP.Net超链接的文字为它创建的URL,然后通过JavaScript设置它的背景色为黄色,从这个通过淡出按钮...

I then click a button titled "Generate" that creates a URL loads the ASP.Net hyperlink with the text for the URL it created and then via javascript sets it's background color to the yellow color to fade from via this...

$("#" + hyperlinkUrlId).css("background-color", "#FBFF9C");

我最初有它通过这个code ...

I initially had it setting the color in the code behind via this code...

Url.BackColor = ColorTranslator.FromHtml("#FBFF9C");

但后来我想,也许后面的颜色越来越被设置为东西颜色的jQuery插件中无法识别,或因为它被设置服务器端插件无法访问它的风格或东西,但它改变还对修复该错误没有影响。

But then I thought maybe the back color was getting set to something the jquery color plug-in couldn't recognize, or since it was being set server side the plug-in couldn't access it's style or something but changing it still had no effect on fixing the bug.

最后,产生从白色变为黄色则该URL的背景色如我所说大部分消失得很好,但很少它抛出一个错误的时间无效的属性值。

Finally, generate changes the URL's back color from white to yellow then as I said most of the time it fades just fine but rarely it throws an error "Invalid property value."

据我可以告诉我的语法是现在的样子,应该是使用彩色动画。我觉得像我使用一个UpdatePanel可能会在这里肆虐,但我不知道的事实。

As far as I can tell my syntax is just the way it should be for using the color animations. I feel like the fact that I'm using an updatepanel might be wreaking havoc here but I'm not sure.

有没有人有任何深入了解什么可能导致这样的事情?这是一个真正的混乱尝试调试因为它发生如此罕见,不顾事实的JavaScript已经是一个痛苦的调试。

Does anyone have any insight into what might cause such a thing? It's been a real mess trying to debug since it happens so infrequently disregarding the fact that javascript is already a pain to debug.

使用jQuery 1.3.1和1.0 jquery.color在Windows Vista上。使用Visual Studio 2008让我知道如果有什么我可以明确起来。

Using jquery 1.3.1 and jquery.color 1.0 on Windows Vista. Using Visual Studio 2008. Let me know if there is anything I can clear up.

编辑:的党,没有一个回应呢。我已经采取了有点裂孔来自这方面的工作,但我刚刚发现的bug在我的应用程序在那里我做的黄色淡出的另一部分。这两个网页使用更新面板。我不是在许多情况下更新面板风扇,它肯定已经在我的jQuery肆虐。我想知道如果有事情做与此有关。呵呵,这是种暗示与整个Vista的事情,但我会指出,我在IIS7运行。

Dang, not a single response yet. I've taken a bit of a hiatus from working on this but I just found the bug in another part of my app where I am doing the yellow fade. Both of these pages use an update panel. I'm not a fan of the update panel in many cases and it has definitely wreaked havoc on my jquery. I'm wondering if it has something to do with this. Oh, this was kind of implied with the whole Vista thing but I'll point out that I'm running on IIS7.

这是否引起任何见解?

Does this provoke any insights?

推荐答案

我觉得我碰到的另一个项目同样的问题,因为你;我有另一个DIV的内部DIV(它没有它的背景明确定义。)我试图闪光的内部DIV的背景颜色,并运行到该错误。我分配一个特定颜色的容器后,才DIV没有错误消失。

I think I ran into the same problem as you on another project; I had a DIV inside of another DIV (which didn't have it's background explicitly defined.) I was trying to "flash" the background color of the inner DIV and was running into that error. Only after I assigned a specific color to the container DIV did the error go away.

这篇关于jQuery的动画色彩间歇喷出属性值无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆