// JavaScript
Image1.onclick = function() {
NSB.MsgBox("clicked");
};
Created page with "file:Bsimage.png == Description == Images in Bootstrap can be made responsive-friendly using the ''responsive'' property. This applies max-width: 100%;, height: auto; an..." |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
Images in Bootstrap can be made responsive-friendly using the ''responsive'' property. This applies max-width: 100%;, height: auto; and display: block; to the image so that it scales nicely to the parent element. | Images in Bootstrap can be made responsive-friendly using the ''responsive'' property. This applies max-width: 100%;, height: auto; and display: block; to the image so that it scales nicely to the parent element. | ||
Images can also be used as buttons by supplying an onclick function. | |||
[[Introduction_to_Bootstrap#Popovers_and_Tooltips|Popovers and Tooltips]] are supported. | [[Introduction_to_Bootstrap#Popovers_and_Tooltips|Popovers and Tooltips]] are supported. | ||
Line 11: | Line 13: | ||
Standard [[properties and methods|properties]] are supported, plus: | Standard [[properties and methods|properties]] are supported, plus: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |||
| center || Should image be centered in container? | |||
|- | |- | ||
| responsive || Should image resize to container? | | responsive || Should image resize to container? | ||
Line 23: | Line 27: | ||
Standard [[events|events]] are supported. For this control, the onclick event will be most useful. | Standard [[events|events]] are supported. For this control, the onclick event will be most useful. | ||
== Example | == Example == | ||
<tabber> | |||
< | JavaScript= | ||
<syntaxhighlight lang="JavaScript"> | |||
NSB.MsgBox(" | // JavaScript | ||
Image1.onclick = function() { | |||
NSB.MsgBox("clicked"); | |||
}; | }; | ||
</ | </syntaxhighlight> | ||
|-| | |||
BASIC= | |||
<syntaxhighlight lang="vb.net"> | |||
' Basic | |||
Function Image1_onclick() | |||
MsgBox "clicked!" | |||
End Function | |||
</syntaxhighlight> | |||
</tabber> | |||
== Output == | == Output == | ||
Line 45: | Line 55: | ||
[[Category:Bootstrap]] | [[Category:Bootstrap]] | ||
Images in Bootstrap can be made responsive-friendly using the responsive property. This applies max-width: 100%;, height: auto; and display: block; to the image so that it scales nicely to the parent element.
Images can also be used as buttons by supplying an onclick function.
Popovers and Tooltips are supported.
Standard properties are supported, plus:
center | Should image be centered in container? |
responsive | Should image resize to container? |
shape | Thumbnail, rounded or circle? |
src | Image path. Set to empty for none. Can be .png, gif, bmp or jpg. |
Standard events are supported. For this control, the onclick event will be most useful.
// JavaScript
Image1.onclick = function() {
NSB.MsgBox("clicked");
};
' Basic
Function Image1_onclick()
MsgBox "clicked!"
End Function