Image (Bootstrap): Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
Line 25: Line 25:
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 (Basic) ==
== Example ==
Images can also be used a buttons by adding a click script:
 
<pre>
<tabber>
JavaScript=
<syntaxhighlight lang="JavaScript">
// JavaScript
Image1.onclick = function() {
    NSB.MsgBox("clicked");
};
</syntaxhighlight>
|-|
BASIC=
<syntaxhighlight lang="vb.net">
' Basic
Function Image1_onclick()
Function Image1_onclick()
   MsgBox "clicked!"
   MsgBox "clicked!"
End Function
End Function
</pre>
</syntaxhighlight>
 
</tabber>
== Example (JavaScript) ==
<pre>
Image1.onclick = function() {
    NSB.MsgBox("clicked");
};</pre>


== Output ==
== Output ==

Revision as of 14:39, 10 March 2019

Description

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.

Popovers and Tooltips are supported.

Properties and Methods

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.

Events

Standard events are supported. For this control, the onclick event will be most useful.

Example

// JavaScript
Image1.onclick = function() {
    NSB.MsgBox("clicked");
};

' Basic
Function Image1_onclick()
  MsgBox "clicked!"
End Function

Output