English 中文(简体)
我能否轻易地“打造”一个被抵消的因素?
原标题:Can I easily "set" an element s offsetWidth?

www.un.org/spanish/ga/president

I m 试图将人口编织成一个tr的元素,其确切的宽度相同。

然而,我倾向于如何确定我的<代码>div swidth,以便其offsetWidthtr完全相同。

计算方法可考虑:

div.width = tr.offsetWidth - div.paddingWidth - div.marginWidth

但肯定会有更好的办法(因为我只能想在两组人中消除婚礼和休妻。)

Specifically, I d like an answer for YUI 2 if possible.

最佳回答

页: 1 那么,像以下东西一样,休息和休息应当:

YAHOO.util.Dom.setStyle(div,  width , tr.offsetWidth +  px );

视您如何处理<条码>div和tr上的边界,您不妨指定<条码>tr.clientWidth。

之后,你可以按照要求,在您的母子/子女身上设定任何差额/婚礼,以实现所期望的出庭。

了解你想要做的事情的关键是了解:clientWidth offsetWidth;以及CSS width是元素的内容领域,不包括任何差额、边界,以及就其定义的pa(

你可以包括婚礼等。 在您的计算中,从中查询

问题回答

这是一种微薄的幻觉,我可能会因为提出这种建议而退缩,但是,如果你不考虑你的边际或婚礼,你可以采取的一种方式,就是将猪肉打上众所周知的价值,然后发现这和四肢解之间的区别。 这应当告诉你,为了使之适合,应该给你打上宽度。

div.style.width =  20px 
diff = div.offsetWidth - 20;
div.style.width = tr.offsetWidth - diff;

确实是迷惑不解的,但你却不敢以这种方式关注婚礼、边或边境。





相关问题
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.

热门标签