background-position-x和background-position-y在IE9上不起作用 [英] background-position-x and background-position-y not working on IE9

查看:82
本文介绍了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.

推荐答案

个人检索财产的不同方式.
如果您同时在Chrome和IE9中查看DOM,那都是一样的-似乎问题(惊讶,意外)与jQuery有关.正在返回躲闪的信息...


IE:
I''d look into a different way of retrieving the property, personally.
If you look at the DOM in both Chrome and IE9, it''s the same - it seems that the problem (surprise, surprise) is with jQuery. It''s returning dodgy information...


IE:
<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


ebtnSearch" id =" =" st yle =" < /输入 >
ebtnSearch" id="ctl00_ebtnSearch_input" value=" Search " style="font-weight:bold;width:100%;padding-left:0;padding-right:0;padding-left:4px;"></input>



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



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上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆