Respond command
Add some lorem filltext to your site for testing.
Basic Usage (HTML)
data-jkit="[respond:width=250,500,750]"
Advanced Init (JavaScript)
$('#myelement').jKit('respond', { 'width': '250,500,750' });
Options
Option | Values | Default | Description |
---|---|---|---|
width | Comma separated string | A comma separated string of element widths in pixels |
Events
Examples
Basic Example:
This basic example show you how the respond command works. Look at the CSS below to see how to make stuff respond correctly. All the command does is set the correct class on the main element.:
Source:
<div id="widgetname" data-jkit="[respond:width=250,500,750]"> widget code <div class="widgetinfo info250">[ This box is at least 250 wide ]</div> <div class="widgetinfo info500">[ This box is at least 500 wide ]</div> <div class="widgetinfo info750">[ This box is at least 750 wide ]</div> </div>
Example CSS
#widgetname { background: #ccc; width: 50%; } #widgetname div.widgetinfo { display: none; } #widgetname.jkit-respond-250 { background: #f90; } #widgetname.jkit-respond-250 div.info250 { display: block; } #widgetname.jkit-respond-500 { background: #9f0; } #widgetname.jkit-respond-500 div.info500 { display: block; } #widgetname.jkit-respond-750 { background: #0f9; } #widgetname.jkit-respond-750 div.info750 { display: block; }
Replacements
There are currently no replacements for this command.
[ Learn more about replacements ]
Discussions
Do you have questions or do you want to suggest new features? Than head over to our new community:
[ jKit Community ]