mirror of
https://github.com/Chalarangelo/mini.css.git
synced 2025-03-13 16:59:39 +01:00
Carousel demo complete
This commit is contained in:
parent
dc39b0e80a
commit
5568dbcf72
@ -598,6 +598,84 @@
|
||||
</div></pre>
|
||||
</div><br>
|
||||
|
||||
<h2 id="carousel">Carousel</h2>
|
||||
<p>The carousel module allows you to create manually-controlled image slideshows for your pages. <strong>Nested carousels might cause unexpected behavior, please refrain from using them.</strong></p>
|
||||
|
||||
<h3>Carousel structure</h3>
|
||||
<p>The base structure for the carousel component is as follows:</p>
|
||||
<ul>
|
||||
<li>Specify a carousel wrapper, using the <code>.carousel</code> class on a <code><div></code> element.</li>
|
||||
<li>Inside the wrapper, add the an <code><input type="radio"></code>, followed immediately by a <code><div></code> element. Inside the latter, add an <code><img></code> element, followed by a <code><div></code> element which will act as the image's description. Finally, right after closing the first <code><div></code> element, add a <code><label></code> linked to the radio button for the image.</li>
|
||||
<li>Repeat the process as many times as you want to add more images. <strong>Remember that you cannot skip the description <code><div></code> element, even if it is empty, as it is required for the component to work properly.</strong></li>
|
||||
<li>Add the <code>checked</code> attribute to the first radio button of your carousel (or the one corresponding to the image you want to be displayed by default) to make the carousel work properly.</li>
|
||||
</ul>
|
||||
<p><strong>Auto-scrolling is not enabled by default in this carousel component.</strong> If you want the carousel to scroll automatically, you can check each of the radio buttons automatically using Javascript on set intervals. Using a similar technique you can pause the automatic scrolling when the user's cursor is inside the carousel.</p>
|
||||
|
||||
<h3>Carousel example</h3>
|
||||
<div class="panel" ><h4 class="head">Example</h4><br>
|
||||
<div class="carousel">
|
||||
<input type="radio" name="carousel-control" id="crs1" checked>
|
||||
<div>
|
||||
<img src="favicon.png">
|
||||
<div>
|
||||
<h3>First image</h3>
|
||||
<p>This is a sample image description.</p>
|
||||
</div>
|
||||
</div>
|
||||
<label for="crs1"></label>
|
||||
<input type="radio" name="carousel-control" id="crs2">
|
||||
<div>
|
||||
<img src="favicon.png" style="transform: scale(1,-1);">
|
||||
<div>
|
||||
<h3>Second image</h3>
|
||||
<p>This is another sample image description.</p>
|
||||
</div>
|
||||
</div>
|
||||
<label for="crs2"></label>
|
||||
<input type="radio" name="carousel-control" id="crs3">
|
||||
<div>
|
||||
<img src="favicon.png" style="transform: scale(-1,-1);">
|
||||
<div>
|
||||
<h3>Third image</h3>
|
||||
<p>This is yet another image description.</p>
|
||||
</div>
|
||||
</div>
|
||||
<label for="crs3"></label>
|
||||
</div>
|
||||
<br>
|
||||
<pre class="panelcode"><div class="carousel">
|
||||
<input type="radio" name="carousel-control" id="crs1" checked>
|
||||
<div>
|
||||
<img src="favicon.png">
|
||||
<div>
|
||||
<h3>First image</h3>
|
||||
<p>This is a sample image description.</p>
|
||||
</div>
|
||||
</div>
|
||||
<label for="crs1"></label>
|
||||
<input type="radio" name="carousel-control" id="crs2">
|
||||
<div>
|
||||
<img src="favicon.png" style="transform: scale(1,-1);">
|
||||
<div>
|
||||
<h3>Second image</h3>
|
||||
<p>This is another sample image description.</p>
|
||||
</div>
|
||||
</div>
|
||||
<label for="crs2"></label>
|
||||
<input type="radio" name="carousel-control" id="crs3">
|
||||
<div>
|
||||
<img src="favicon.png" style="transform: scale(-1,-1);">
|
||||
<div>
|
||||
<h3>Third image</h3>
|
||||
<p>This is yet another image description.</p>
|
||||
</div>
|
||||
</div>
|
||||
<label for="crs3"></label>
|
||||
</div></pre>
|
||||
</div><br>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user