本文介绍了background-position-x和background-position-y在IE9上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取控件的"backgroundPosition",该控件在chrome上可以正常运行,但照常在IE上不能正常运行.为此,我正在使用jquery的background-position-x,background-position-y,backgroundPositionX,backgroundPositionY属性.上面提到的属性在IE上对我的一个应用程序正常工作,但在其他应用程序上未给出任何结果.
我真的无法获得特定应用程序而不是其他应用程序支持某些预定义属性的方式.

I am trying to get ''backgroundPosition'' of control, which works fine on chrome but as usual not on IE.
Workaround for this i am using background-position-x,background-position-y,backgroundPositionX,backgroundPositionY properties of jquery.The properties mentioned above works fine for one of my application on IE but doesn''t give any result on other application.
Can''t really get how''s it possible that certain predefined properties are supported by particular app and not by other.

推荐答案

<input style="width: 100%; padding-right: 0px; padding-left: 4px; font-weight: bold;" id="ctl00_ebtnSearch_input"></input>



铬:



Chrome:

<input class="rbDecorated" type="submit" name="ctl00




实际上,这在两个浏览器中都返回":



In fact, this returns "" in both browsers:

document.getElementById('ctl00_ebtnSearch_input').style.background



鉴于从DOM显然可以看出,没有任何内嵌样式(或通过javascript应用的内嵌样式)影响.style.background-或任何背景的属性,这完全是合理的.


您想要得到什么,目的是什么?也许还有另一种未被考虑的解决方案.



Which is entirely reasonable, given that clearly from the DOM, there is no inline style (or one applied through javascript) that affects .style.background - or any of background''s attributes.


What are you trying to get, and for what purpose? Perhaps there''s another solution that''s not been considered..


这篇关于background-position-x和background-position-y在IE9上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 17:41