Strict Standards: Declaration of action_plugin_dlcount::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/dlcount/action.php on line 14

Strict Standards: Declaration of action_plugin_indexmenu::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/indexmenu/action.php on line 169

Strict Standards: Declaration of action_plugin_ipban::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/ipban/action.php on line 67

Strict Standards: Declaration of action_plugin_loglog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/loglog/action.php on line 82

Strict Standards: Declaration of action_plugin_navi::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/navi/action.php on line 46

Strict Standards: Declaration of action_plugin_uparrow::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/uparrow/action.php on line 69

Strict Standards: Declaration of action_plugin_userspagecreate::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/userspagecreate/action.php on line 97

Strict Standards: Declaration of cache_instructions::retrieveCache() should be compatible with cache::retrieveCache($clean = true) in /home/www/wiki/inc/cache.php on line 289

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/auth.php on line 312

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 71

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/actions.php on line 154
Slider [phpwcms-HowTo:wiki]

Strict Standards: Declaration of syntax_plugin_code::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/code/syntax.php on line 41

Strict Standards: Declaration of syntax_plugin_tip::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/tip/syntax.php on line 38

Slider

Einfacher Bilder-Slider mit Template- und CSS Dateien

Voraussetzung: mootools 1.1.x oder mootools 1.2.x

Frontendausgabe mit LightBox

Ausgabe im FE: Slider

Backend

LightBox: ein, Effekt 1/3: ein, zuschneiden Thumb 95×115: ein

Backend


Template mootools V1.1.x

/template/inc_cntpart/imagespecial/slider_new_11x.tmpl

/template/inc_cntpart/imagespecial/slider_new.tmpl

<!--IMAGES_HEADER_START//-->
 
[TITLE]<h1>{TITLE}</h1>[/TITLE]
[SUBTITLE]<h2>{SUBTITLE}</h2>[/SUBTITLE]
[TEXT]{TEXT}[/TEXT]
 
    [EFFECT_1][Ich bin der Effekt 1] : [/EFFECT_1]
    [EFFECT_2][Ich bin der Effekt 2] : [/EFFECT_2]
    [EFFECT_3][Ich bin der Effekt 3]<br />[/EFFECT_3]
 
<div class="slider" id="slider_container_{ID}">
  <div id="slider_{ID}" class="inner">
<!--IMAGES_HEADER_END//-->
 
 
<!--IMAGES_ENTRY_START//-->
    [ZOOM]<a href="{IMAGE_ABS}" title="{INFOTEXT}" target="_blank"{LIGHTBOX}><img src="{THUMB_ABS}" alt="{CAPTION}" border="0" /><br />
<span class="thumb_capture">{INFOTEXT}</span></a>
[/ZOOM][ZOOM_ELSE]
    [IMAGE_URL]<a href="{IMAGE_URL}"{IMAGE_TARGET}>[/IMAGE_URL]<img src="{THUMB_ABS}" alt="{THUMB_NAME}" border="0" />[IMAGE_URL]</a>[/IMAGE_URL]
[/ZOOM_ELSE]
<!--IMAGES_ENTRY_END//-->
 
 
<!--IMAGES_ENTRY_SPACER_START//--><!--IMAGES_ENTRY_SPACER_END//-->
 
 
<!--IMAGES_ROW_SPACER_START//--><!--IMAGES_ROW_SPACER_END//-->
 
 
<!--IMAGES_FOOTER_START//-->
  </div>
</div>
<a href="#" id="move_left_{ID}">&laquo; Left &laquo;</a> | <a href="#" id="move_right_{ID}">&raquo; Right &raquo;</a>
 
 
[PHP]
 
  $GLOBALS['block']['css']['slider_{ID}'] = 'specific/slider_new.css';
 
  $GLOBALS['block']['custom_htmlhead']['slider_{ID}'] = '  <script type="text/javascript">
  <!--
 
  window.addEvent(\'domready\', function(){
 
    var slider_width  = 0;
    var step      = 106;
    var scroll_x    = 0;
    var slider_parent = $(\'slider_container_{ID}\').getSize().size.x;
 
    $$(\'div.slider a\').each( function(e) {
 
      slider_width += e.getSize().size.x + 5;
 
    });
 
    var scroll = new Fx.Scroll(\'slider_container_{ID}\', {
      wait: false,
      duration: 550,
      offset: {\'x\': 0, \'y\': 0},
      transition: Fx.Transitions.Quad.easeOut
    });
 
    scroll.scrollTo(0, 0);
 
    $(\'move_right_{ID}\').addEvent(\'click\', function(event) {
      event = new Event(event).stop();
      if(slider_width-slider_parent <= scroll_x) {
        scroll_x = scroll_x - 106;
      }
      scroll_x = scroll_x + 106;
      scroll.scrollTo(scroll_x, 0);
    });
 
    $(\'move_left_{ID}\').addEvent(\'click\', function(event) {
      event = new Event(event).stop();
      scroll_x = scroll_x - 106;
      if(scroll_x < 0) {
        scroll_x = 0;
      }
      scroll.scrollTo(scroll_x, 0);
    });
 
 
  });
 
  //-->
  </script>';
 
[/PHP]
<!--IMAGES_FOOTER_END//-->


Template mootools V1.2.x

Für die Verwendung mit den Mootools V1.2.x wurde das Skript erweitert um

Fx.Scroll.implement({
  scrollTo: function(y, x){
  return this.start(y, x);
  }
});

und alle

getSize().size 

ersetzt durch

getSize()

Update 15.06.2010 KH:

  • Zeile in [ZOOM_ELSE]….[/ZOOM_ELSE] korrigiert, da im JS auf ”<a …” getriggert wird. (Siehe hierzu Unterschied zum Originaltemplate).
  • Aufruf FX.Scroll nach [PHP]… ausgelagert, da Reihenfolge der Scripte nicht optimal.


/template/inc_cntpart/imagespecial/slider_new_12x.tmpl

/template/inc_cntpart/imagespecial/slider_new_12x.tmpl

<!--IMAGES_HEADER_START//-->
 
[TITLE]<h1>{TITLE}</h1>[/TITLE]
[SUBTITLE]<h2>{SUBTITLE}</h2>[/SUBTITLE]
[TEXT]{TEXT}[/TEXT]
 
    [EFFECT_1][Ich bin der Effekt 1] : [/EFFECT_1]
    [EFFECT_2][Ich bin der Effekt 2] : [/EFFECT_2]
    [EFFECT_3][Ich bin der Effekt 3]<br />[/EFFECT_3]
 
<div class="slider" id="slider_container_{ID}">
  <div id="slider_{ID}" class="inner">
<!--IMAGES_HEADER_END//-->
 
 
<!--IMAGES_ENTRY_START//-->
    [ZOOM]<a href="{IMAGE_ABS}" title="{INFOTEXT}" target="_blank"{LIGHTBOX}><img src="{THUMB_ABS}" alt="{CAPTION}" border="0" /><br />
<span class="thumb_capture">{INFOTEXT}</span></a>
[/ZOOM][ZOOM_ELSE]
    <a href="#"><img src="{THUMB_ABS}" alt="{THUMB_NAME}" border="0" /></a>
[/ZOOM_ELSE]
<!--IMAGES_ENTRY_END//-->
 
 
<!--IMAGES_ENTRY_SPACER_START//--><!--IMAGES_ENTRY_SPACER_END//-->
 
 
<!--IMAGES_ROW_SPACER_START//--><!--IMAGES_ROW_SPACER_END//-->
 
 
<!--IMAGES_FOOTER_START//-->
  </div>
</div>
<a href="#" id="move_left_{ID}">&laquo; Left &laquo;</a> | <a href="#" id="move_right_{ID}">&raquo; Right &raquo;</a>
 
 
[PHP]
 
  $GLOBALS['block']['css']['slider_{ID}'] = 'specific/slider_new.css';
 
  $mootools_more = array( 'Fx/Fx.Scroll' );  // Loading more and FX.Scroll lib
  initJSPlugin($mootools_more, true);
 
  $GLOBALS['block']['custom_htmlhead']['slider_{ID}'] = '  <script type="text/javascript">
  <!--
  // 17.04.09 KH: enhanced and patched for mootools V1.2x
 
  window.addEvent(\'domready\', function(){
 
  Fx.Scroll.implement({
    scrollTo: function(y, x){
    return this.start(y, x);
    }
  });
 
    var slider_width  = 0;
    var step          = 106;
    var scroll_x      = 0;
    var slider_parent = $(\'slider_container_{ID}\').getSize().x;
 
    $$(\'div.slider a\').each( function(e) {
 
      slider_width += e.getSize().x + 5;
 
    });
 
    var scroll = new Fx.Scroll(\'slider_container_{ID}\', {
      wait: false,
      duration: 550,
      offset: {\'x\': 0, \'y\': 0},
      transition: Fx.Transitions.Quad.easeOut
    });
 
    scroll.scrollTo(0, 0);
 
    $(\'move_right_{ID}\').addEvent(\'click\', function(event) {
      event = new Event(event).stop();
      if(slider_width-slider_parent <= scroll_x) {
        scroll_x = scroll_x - 106;
      }
      scroll_x = scroll_x + 106;
      scroll.scrollTo(scroll_x, 0);
    });
 
    $(\'move_left_{ID}\').addEvent(\'click\', function(event) {
      event = new Event(event).stop();
      scroll_x = scroll_x - 106;
      if(scroll_x < 0) {
        scroll_x = 0;
      }
      scroll.scrollTo(scroll_x, 0);
    });
 
 
  });
 
  //-->
  </script>';
 
[/PHP]
<!--IMAGES_FOOTER_END//-->


CSS

/template/inc_css/specific/slider_new.css

/template/inc_css/specific/slider_new.css

div.slider {
   margin: 10px 0 10px 0;
   padding: 5px 0 5px 0;
   background-color: #888;
   overflow: hidden;
   width: 323px;
   position: relative;
   height: 146px;
}
 
div.slider .thumb_capture p {
   font-size: 9px;
   color: #444;
   background: #ddd;
   min-height: 25px;
 
}
 
div.slider div.inner {
   margin: 0;
   padding: 0;
   list-style: none;
   height: 146px;
   width: 700px;
   position: absolute;
   left: 0;
   top: 5px;
}
 
div.slider div.inner a {
   border: 3px solid #FFFFFF;
   padding: 0;
   float: left;
   background-color: #000000;
   margin: 0 0 0 5px;
}
div.slider div.inner a:hover {
   border: 3px solid #cfe9ff;
   text-decoration: none;
}
div.slider div.inner a img {
   width: 95px;
}


Erweiterte Variante

Siehe: Slider erweitert (Forum: http://forum.phpwcms.org/viewtopic.php?p=123104#p123104)

Vorteile:
- Breite, Höhe und Länge des Sliders richten sich nach den Einstellungen der Bildvorschaugrösse und Spaltenanzahl
- Bei mehreren Slidern auf einer Seite kann man nicht mehr über das Ende hinaus scrollen


deutsch/phpwcms-system/artikel/contentparts/bilder-spezial/slider.txt · Last modified: 2011/01/08 22:04 by Knut Heermann (flip-flop)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 79