1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
---
title: image
slug: Archive/Mozilla/XUL/image
tags:
- Elementos XUL
- Referência XUL
translation_of: Archive/Mozilla/XUL/image
---
<div class="noinclude"><span class="breadcrumbs XULRef_breadcrumbs">
« <a href="/pt-PT/docs/XUL_Reference">XUL Reference home</a> [
<a href="#Examples">Examples</a> |
<a href="#Attributes">Attributes</a> |
<a href="#Properties">Properties</a> |
<a href="#Methods">Methods</a> |
<a href="#Related">Related</a> ]
</span></div>
<h3 id="Resumo">Resumo</h3>
<p>Um elemento que exibe uma imagem, bem como o elemento <a href="/En/HTML/Element/Img" title="https://developer.mozilla.org/en/HTML/element/img"><code>img</code></a> de HTML. O atributo <code id="a-src"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code> pode ser utilziado para especificar o URL da imagem.</p>
<p>Está disponível mais informação no <a href="/pt-PT/docs/Mozilla/Tech/XUL/Tutorial/Adicionar_Etiquetas_e_Imagens" title="en/XUL_Tutorial/Adding_Labels_and_Images">Tutorial de XUL</a>.</p>
<div class="noinclude">
<div class="note">
<p><strong>Nota:</strong> Prior to <span title="(Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5)">Gecko 8.0</span>, images did not shrink down with the same ratio in both directions when specifying maximum sizes using <code>maxheight</code> or <code>maxwidth</code>. The new behavior aligns more with the HTML <a href="/pt-PT/docs/Web/HTML/Element/img" title="The documentation about this has not yet been written; please consider contributing!"><code><img></code></a> element and shrinks both the width and height down proportionally.</p>
</div>
</div>
<dl>
<dt>Atributos</dt>
<dd><a href="#a-onerror">onerror</a>, <a href="#a-image.onload">onload</a>, <a href="#a-src">src</a>, <a href="#a-validate">validate</a></dd>
</dl>
<dl>
<dt>Propriedades</dt>
<dd><a href="#p-accessibleType">accessibleType</a>, <a href="#p-src">src</a></dd>
</dl>
<dl>
<dt>Classes de estilo</dt>
<dd><a href="#s-alert-icon">alert-icon</a>, <a href="#s-error-icon">error-icon</a>, <a href="#s-message-icon">message-icon</a>, <a href="#s-question-icon">question-icon</a></dd>
</dl>
<h3 id="Exemplos">Exemplos</h3>
<div class="float-right"><img alt="Image:Firefoxlogo2.png" class="internal" src="/@api/deki/files/220/=Firefoxlogo2.png"></div>
<pre class="eval"><image src='Firefoxlogo.png' width='135' height='130'/>
</pre>
<h3 id="Atributos">Atributos</h3>
<p> </p><div id="a-onerror">
<dl>
<dt><code id="a-onerror"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/onerror">onerror</a></code></dt>
<dd>Type: <em>script code</em></dd>
<dd>This event is sent to an <code><a href="/en-US/docs/Mozilla/Tech/XUL/image" title="image">image</a></code> element when an error occurs loading the image.</dd>
</dl>
</div> <div id="a-image.onload">
<dl>
<dt><code id="a-image.onload"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/image.onload">image.onload</a></code></dt>
<dd>Type: <em>script code</em></dd>
<dd>This event handler will be called on the <code><a href="/en-US/docs/Mozilla/Tech/XUL/image" title="image">image</a></code> element when the image has finished loading. This applies whether the image is applied via the <code id="a-src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code> attribute or the <code>list-style-image</code> style property. If you change the image, the event will fire again when the new image loads. This event will not bubble up the element tree.</dd>
</dl>
</div> <div id="a-src">
<dl>
<dt>
<code id="a-src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code></dt>
<dd>
Type: <em>URI</em></dd>
<dd>
The URI of the content to appear in the element.</dd>
</dl>
</div> <div id="a-validate">
<dl>
<dt><code id="a-validate"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/validate">validate</a></code></dt>
<dd>Type: <em>one of the values below</em></dd>
<dd>This attribute indicates whether to load the image from the cache or not. This would be useful if the images are stored remotely or you plan on swapping the image frequently. The following values are accepted, or leave out the attribute entirely for default handling:</dd>
<dd>
<dl>
<dt><code>always</code></dt>
<dd>The image is always checked to see whether it should be reloaded.</dd>
<dt><code>never</code></dt>
<dd>The image will be loaded from the cache if possible.</dd>
</dl>
</dd>
</dl>
</div>
<h3 id="Propriedades">Propriedades</h3>
<div id="p-accessibleType">
<dl>
<dt>
<code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
<dd>
Type: <em>integer</em></dd>
<dd>
A value indicating the type of accessibility object for the element.</dd>
</dl>
</div> <div id="p-src">
<dl>
<dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/src">src</a></span></code></dt>
<dd>Type: <em>URL</em></dd>
<dd>Gets and sets the value of the <code id="a-src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code> attribute.</dd>
</dl></div> <table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
</table>
<h3 id="Métodos">Métodos</h3>
<table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Methods</strong><br> <small><code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.appendChild">appendChild()</a></code>, <span id="m-blur"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.cloneNode">cloneNode()</a></code>, <a class="internal" href="/En/DOM/Node.compareDocumentPosition" title="En/DOM/Node.compareDocumentPosition">compareDocumentPosition</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getBoundingClientRect">getBoundingClientRect()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getClientRects">getClientRects()</a></code>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span>, <span id="m-getElementsByAttributeNS"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/getElementsByAttributeNS">getElementsByAttributeNS</a></code></span>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getElementsByClassName">getElementsByClassName()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <a class="internal" href="/En/DOM/Node.getFeature" title="En/DOM/Node.getFeature">getFeature</a>, <a class="internal" href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">getUserData</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.isDefaultNamespace">isDefaultNamespace()</a></code>, <a class="internal" href="/En/DOM/Node.isEqualNode" title="En/DOM/Node.isEqualNode">isEqualNode</a>, <a class="internal" href="/En/DOM/Node.isSameNode" title="En/DOM/Node.isSameNode">isSameNode</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.isSupported">isSupported()</a></code>, <a class="internal" href="/En/DOM/Node.lookupNamespaceURI" title="En/DOM/Node.lookupNamespaceURI">lookupNamespaceURI</a>, <a class="internal" href="/En/DOM/Node.lookupPrefix" title="En/DOM/Node.lookupPrefix">lookupPrefix</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.querySelector">querySelector()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.querySelectorAll">querySelectorAll()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code>, <a class="internal" href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">setUserData</a></small></p> </td> </tr> </tbody>
</table>
<h3 id="Classes_de_estilo">Classes de estilo</h3>
<dl>
<dt>
<code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/alert-icon">alert-icon</a></code></dt>
<dd>
Class that adds an alert icon. This typically looks like an exclamation mark. This and the other icon classes may be used by <code><a href="/en-US/docs/Mozilla/Tech/XUL/image" title="image">image</a></code> elements or other elements which can have an image.</dd>
</dl> <dl>
<dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/error-icon">error-icon</a></code></dt>
<dd>Class that adds an error icon. This will typically be a red "X" icon.</dd>
</dl> <dl>
<dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/message-icon">message-icon</a></code></dt>
<dd>Class that adds a message box icon.</dd>
</dl> <dl>
<dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/question-icon">question-icon</a></code></dt>
<dd>Class that adds a question icon, which usually looks like a question mark.</dd>
</dl>
<h3 id="Relacionado">Relacionado</h3>
<p>See also the <code id="a-image"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> and <code id="a-icon"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/icon">icon</a></code> attributes.</p>
<h3 id="Interfaces">Interfaces</h3>
<ul>
<li><code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAccessibleProvider" title="">nsIAccessibleProvider</a></code></li>
<li><code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMXULImageElement" title="">nsIDOMXULImageElement</a></code></li>
</ul>
<div class="noinclude"></div>
|