BLANK_IMAGE_URL, a simple explanation? - Ext JS

本文讨论了ExtJS框架中默认使用的1x1透明GIF图像(s.gif)的作用。该图像用于创建带有CSS背景图像的内联图标,并作为iframe的src属性使用,以阻止z-index不友好的元素。文章还提供了如何配置此图像路径的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Hi, I realise this must have been asked tons of times (a quick search of the forums confirms this statement!).
Is there anywhere in the docs (a forum post suggested, checking the code, and the docs, which I have done to limited success
Quote:
* URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. (Defaults to
* "http://www.yui-ext.com/s.gif" and you should change this to a URL on your server).
)
which explains *why* it defaults to http://www.yui-ext.com/s.gif, when s.gif exists locally in the Resources/Images/<default/aero/etc>/s.gif ?

Does it have to be an absolute path to a server? (it seems to work ok for me with a relative path)

I apologise again if I'm missing something useful/obvious/well-documented, and if someone could point me to the relevant docs I'm happy to go and read

[/quote]
Reply With Quote
  #2  
Old 03-13-2007, 04:55 PM
Defaultreponse

hi
the best reponse i can figure out for that is that the library is loaded in a dynamic way and could be anywhere (ex: /lib/ext-1.0alpha3/ext-all.js or just ./ext-all.js)

there is no need you to load the css files (you can just to load the ext-all.js file) but the blank image is needed to render some thinks like the tree and other visual stuff

anyway what i do is:
1 load the ext lib
3 load the css
2 set the BLANK_IMAGE_URL in the initialization to a path i know it is there

ex:

<script type="text/javascript" src="./ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="./ext-all.css"></script>
<script type="text/javascript">
Ext.BLANK_IMAGE_URL = "./resources/images/default/s.gif";
</script>
Reply With Quote
  #3  
Old 03-13-2007, 05:04 PM
Default

Jack uses iframes as "shims" for modal dialogs to block out z-index unfriendly elements, like select boxes. I think that in-order for those iframs to render, you need to provide them a src attribute, so he provides that url as the src of the iframe. You can configure where that image will live in your docroot via that constant.
Reply With Quote
  #4  
Old 03-14-2007, 03:35 AM
Default

Quote:
Originally Posted by juantascon
the best reponse i can figure out for that is that the library is loaded in a dynamic way and could be anywhere (ex: /lib/ext-1.0alpha3/ext-all.js or just ./ext-all.js)
Hmm, I guess this makes sense, I had 'assumed' that everyone stuck 'Resources' at their url root, this must be the 'root' <sic> of my mis-understanding !

Thanks!
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值