English 中文(简体)
三级保险金的回报价值
原标题:returning CSS value for a jQuery UI element

我不敢肯定,如果可以通过j Query或其他方法做到这一点,但我会把主题交换器的植被纳入我的网络信息。 我有一套可选择的“倡议”要素,我想以与当前主题一样,在页数/主题交换时,以直线标示。 我试图将背景价值储存在var中,因此,我可以使用......cs确定可选择的颜色,以匹配。

未定义的回返,但如果我尝试的话

input = $( .ui-state-default ).css( color )

我可以回馈一个价值。

我有什么误解?

最佳回答

您的第一个实例是:您在前没有时间过,因此,您正在尝试用一种精华的精华语(而不是一种DIV、INPUT、SlectT等)挑选内容。

 $( ui-state-highlight )

你的第二个实例是,你实际上选择了带有一类自毁的成分。

 $( .ui-state-default )

<><>Edit>: 根据您的更正,我猜测,这里的问题是,你可能会试图为具有光辉阶级的任何要素找到背景,但确实在贵页上显示有点。

Try the following Code, based on response to 2. 从外部风格表获取CSS价值,地址是Javascript/jQuery

var $p = $("<p class= ui-state-highlight ></p>").hide().appendTo("body"); 
input = $p.css("background"); 
$p.remove(); 

You create a new <p></p> temporarily and then grab the background color off it before removing it.

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签