Flamingo.Device.isType()¶
The isType() method returns TRUE if the device specified in the parameter type matches the current user’s device and returns FALSE otherwise.
Syntax¶
Flamingo.Device.isType(deviceType)
Parameters¶
Parameter | Type | Description |
deviceType | String | ’phone’, ‘tablet’ or ‘desktop’ |
Return Value¶
Type | Description |
---|---|
Boolean | TRUE if the device specified in the parameter type matches the current user’s device and FALSE otherwise. |
Example¶
You can use the following code in template to display image with different resolution depending on the currently used device:
<!--{if Flamingo.Device.isType('phone')}-->
<img src="picture200x200.png" alt="small picture" />
<!--{elseif Flamingo.Device.isType('tablet')}-->
<img src="picture400x400.png" alt="medium picture" />
<!--{elseif Flamingo.Device.isType('desktop')}-->
<img src="picture600x600.png" alt="large picture" />
<!--{/if}-->
See also