English 中文(简体)
Jquery AddClass在IE7中因装饰而失效
原标题:Jquery addClass function fails in IE7 for td element

罗马尼亚

<td class="width2 padLeft" id="loading_45">&nbsp;</td> 

The following JQuery:

$( #loading_45 ).addClass( loading );

定义如下:

td.loading
{
    background-image:url("../images/icon_loading_circle.gif");
    background-position:left center;
    background-repeat:no-repeat;
    height:auto; 
    position:absolute;
    text-align:center;
}

IE7(FF的工厂罚款)没有造成背景估计。

是否有任何人认为我做了什么错误?

As Pointy noted the problem was in the css the position:absolute; definition should be removed Thanks all for answering so fast

最佳回答

我确信,如果(作为“绿灯”)你在适当的时候重新这样做的话,“附加物”即为working。 既然在“你”工作,你可能就是这样。

我怀疑,问题可能只是你的风格是使国际E7脱离。 将“位置:绝对”放在一个表层,可能会造成问题,如使桌子完全错位。 当我尝试时,桌子总是在页上左上角,尽管风格上没有具体指明“上”或“左”。

在桌子上用硬编码对你一页进行测试,看情况。

问题回答

确保该守则在人力部装满后运行

$(function(){
   $( #loading_45 ).addClass( loading );
});

$(document).ready(function(){
   $( #loading_45 ).addClass( loading );
});

并且确保这些要素的宽度/宽度符合背景形象。

Demo: http://www.jsfiddle.net/9PZZB/2/





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签