Firefox jQuery UI 位置效果
这需要一些历史记录,以便您可以了解一个修复如何变成了一个本身需要修复的问题:
看看 这个 jsFiddle 在 Firefox 中。单击该按钮,您将看到 HTML 区域的左上角出现一个栗色框。在 Chrome、IE 和 Safari 中,在同一个 jsFiddle 中,带有复选框的单元格将显示栗色框,然后淡出到背景,这就是所需的行为。
请注意,在 js 代码和 css 中,div 被添加到复选框单元格,然后淡出。这应该是这个jsFiddle中发现的问题的解决方案。在 js 代码中,您可以看到我使用了 UI 高亮效果,该效果适用于所有浏览器,但在转到背景图像之前会淡出为白色。
为了解决淡入白色然后变成背景图像的问题,以前的 jsFiddle 应该是解决方案,但它只引入了 Firefox 问题。尝试使用 UI 的位置效果来解决这个问题并没有帮助。
如果有人能帮助我找到一种跨浏览器解决方案,该解决方案可以突出显示复选框单元格,而不会像突出显示效果那样褪色为白色,我将不胜感激。
<代码>
This requires a bit of history so you can see how one fix has only turned into a problem that itself needs to be fixed:
Take a look at this jsFiddle in Firefox. Click on the button and you'll see a maroon box show up in the upper left corner of the HTML area. In Chrome, IE, and Safari, in the same jsFiddle, the cell with the checkbox will get the maroon box show and then fade out to the background, which is what the desired behavior is.
Note in the js code and the css that a div is added to the checkbox cells and then faded out. This was supposed to be the solution to a problem found in this jsFiddle. In the js code there you can see that I use the UI Highlight effect, which works in all browsers, but fades to white before going to the background image.
To address the fade to white then to background image problem, the former jsFiddle was supposed to be the fix, which only introduced the Firefox problem. And trying to fix that using UI's Position effect didn't help.
I'd be eternally grateful if someone could help me find a cross-browser solution that highlights the checkbox cells without fading to white, as the Highlight effect does.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将您的输入包装到
中,它也可以在 FF 中工作。 FF 中表中的绝对定位似乎是一个问题,即使
具有
position:relative
。这是修改后的fiddle。
也可以仅使用 jQuery 进行动态包装/展开。按以下方式修改你的JS:
这里是 fiddle
Wrap your input into a
<div style="position: relative">
and it will work in FF too. Absolute positioning in tables in FF seems to be a problem, even if the<td>
hasposition: relative
.Here is the modified fiddle.
It's also possible with jQuery only with dynamic wrapping / unwrappring. Modify your JS the following way:
Here this fiddle
这不是问题——是你的问题。 Td 不能相对定位。使用 div iside td width
position:relative
it is nott ff problem - its your. Td cannot be positioned relative. Use div iside td width
position:relative