Tips and Tricks: carouFredSel: Unterschied zwischen den Versionen

Aus CodeCoupler Wiki
Zur Navigation springen Zur Suche springen
Tm (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Tm (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Zeile 6: Zeile 6:


<pre>
<pre>
<!-- WILL NOT WORK ! -->
<div class="col-xs-8" id="slideshow">
<div class="col-xs-8" id="slideshow">
   <img src="assets/img/1.jpg" width="663" height="491">
   <img src="assets/img/1.jpg" width="663" height="491">
Zeile 45: Zeile 46:
$(function(){
$(function(){
   $('#slideshow').carouFredSel();
   $('#slideshow').carouFredSel();
})
</pre>
== Enabling Swiping ==
You have to enable swiping-support in the component configuration (it's enabled by default):
<pre>
$config['master_components']['gui-libraries.sliders.carouFredSel']['config'] = array(
    'swiping' => TRUE
);
</pre>
Then you have to add the following to your JavaScript:
<pre>
$(function(){
    $('#slideshow').carouFredSel({
swipe:{
    onTouch: true,
}
    });
})
</pre>
You can additionaly enable sliding by dragging with the mouse:
<pre>
$(function(){
    $('#slideshow').carouFredSel({
swipe:{
    onTouch: true,
    onMouse: true
}
    });
})
})
</pre>
</pre>

Version vom 2. März 2014, 15:12 Uhr

Some Basics

Using with Bootstrap Grids

Do not convert a Bootstrap Grid-Div into a CarouFredSel-Slider:

<!-- WILL NOT WORK ! -->
<div class="col-xs-8" id="slideshow">
   <img src="assets/img/1.jpg" width="663" height="491">
   <img src="assets/img/2.jpg" width="663" height="491">
   <img src="assets/img/3.jpg" width="663" height="491">
   <img src="assets/img/4.jpg" width="663" height="491">
</div>

This will break the Grid Layout. Use instead an own Div for the Slideshow:

<div class="col-xs-8">
   <div id="slideshow">
      <img src="assets/img/1.jpg" width="663" height="491">
      <img src="assets/img/2.jpg" width="663" height="491">
      <img src="assets/img/3.jpg" width="663" height="491">
      <img src="assets/img/4.jpg" width="663" height="491">
   </div>
</div>

Simple Slider

HTML:

<div id="slideshow">
   <img src="assets/img/1.jpg" width="663" height="491">
   <img src="assets/img/2.jpg" width="663" height="491">
   <img src="assets/img/3.jpg" width="663" height="491">
   <img src="assets/img/4.jpg" width="663" height="491">
</div>

JS:

$(function(){
   $('#slideshow').carouFredSel();
})

Enabling Swiping

You have to enable swiping-support in the component configuration (it's enabled by default):

$config['master_components']['gui-libraries.sliders.carouFredSel']['config'] = array(
    'swiping' => TRUE
);

Then you have to add the following to your JavaScript:

$(function(){
    $('#slideshow').carouFredSel({
	swipe:{
	    onTouch: true,
	}
    });
})

You can additionaly enable sliding by dragging with the mouse:


$(function(){
    $('#slideshow').carouFredSel({
	swipe:{
	    onTouch: true,
	    onMouse: true
	}
    });
})