Skip to content

Commit

Permalink
- Fix fading animation not linking properly due to absolute positions…
Browse files Browse the repository at this point in the history
… (thanks to @mkalus)
  • Loading branch information
uoziod committed Sep 6, 2015
1 parent d52e6f0 commit d59cb58
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 49 deletions.
52 changes: 22 additions & 30 deletions ext_emconf.php
Original file line number Diff line number Diff line change
@@ -1,47 +1,39 @@
<?php

########################################################################
# Extension Manager/Repository config file for ext "simple_slider".
#
# Auto generated 13-01-2014 06:29
#
# Manual updates:
# Only the data in the array - everything else is removed by next
# writing. "version" and "dependencies" must not be touched!
########################################################################
/***************************************************************
* Extension Manager/Repository config file for ext "simple_slider".
*
* Auto generated 12-07-2015 10:03
*
* Manual updates:
* Only the data in the array - everything else is removed by next
* writing. "version" and "dependencies" must not be touched!
***************************************************************/

$EM_CONF[$_EXTKEY] = array(
$EM_CONF[$_EXTKEY] = array (
'title' => 'Simple Slider',
'description' => 'Allows to add box of images with text, switching between each-others with couple animation effects. TYPO3 6 ready. jQuery is needed.',
'description' => 'Allows to add box of images with text, switching between each-others with couple animation effects. jQuery is needed.',
'category' => 'plugin',
'shy' => 0,
'version' => '1.0.5',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
'loadOrder' => '',
'module' => '',
'version' => '1.0.7',
'state' => 'stable',
'uploadfolder' => 1,
'uploadfolder' => true,
'createDirs' => '',
'modify_tables' => '',
'clearcacheonload' => 0,
'lockType' => '',
'clearcacheonload' => true,
'author' => 'Semyon Vyskubov',
'author_email' => '[email protected]',
'author_company' => '',
'CGLcompliance' => '',
'CGLcompliance_note' => '',
'constraints' => array(
'depends' => array(
'constraints' =>
array (
'depends' =>
array (
'typo3' => '4.5.17-6.2.99',
),
'conflicts' => array(
'conflicts' =>
array (
),
'suggests' => array(
'suggests' =>
array (
),
),
'_md5_values_when_last_written' => 'a:21:{s:9:"ChangeLog";s:4:"bf57";s:10:"README.txt";s:4:"ee2d";s:12:"ext_icon.gif";s:4:"242c";s:17:"ext_localconf.php";s:4:"d6ed";s:14:"ext_tables.php";s:4:"1ffd";s:14:"ext_tables.sql";s:4:"af8e";s:15:"flexform_ds.xml";s:4:"51a8";s:30:"icon_tx_simpleslider_items.gif";s:4:"7c58";s:13:"locallang.xml";s:4:"eac1";s:16:"locallang_db.xml";s:4:"5456";s:7:"tca.php";s:4:"2495";s:14:"doc/manual.sxw";s:4:"f7e2";s:19:"doc/wizard_form.dat";s:4:"d40f";s:20:"doc/wizard_form.html";s:4:"a234";s:10:"js/main.js";s:4:"6862";s:14:"pi1/ce_wiz.gif";s:4:"794d";s:33:"pi1/class.tx_simpleslider_pi1.php";s:4:"b210";s:41:"pi1/class.tx_simpleslider_pi1_wizicon.php";s:4:"3299";s:13:"pi1/clear.gif";s:4:"cc11";s:17:"pi1/locallang.xml";s:4:"b472";s:22:"templates/default.html";s:4:"d5e2";}',
);

?>
39 changes: 20 additions & 19 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
jQuery(document).ready(function() {

tx_simpleslider_pi1_conf['items'] = new Array();
tx_simpleslider_pi1_conf['items'] = [];
tx_simpleslider_pi1_conf['focus'] = true;

jQuery('.tx-simpleslider-pi1-slider').each(function(count) {

jQuery(this).attr('id', 'tx-simpleslider-pi1-slider-' + count);
jQuery(this).find('.tx-simpleslider-pi1-switcher').attr('id', 'tx-simpleslider-pi1-switcher-' + count);

tx_simpleslider_pi1_conf['items'][count] = new Array();
tx_simpleslider_pi1_conf['items'][count] = [];

var items = jQuery(this).find('.tx-simpleslider-pi1-item');

Expand Down Expand Up @@ -53,16 +53,19 @@ jQuery(document).ready(function() {

tx_simpleslider_pi1_conf['items'][count]['interval'] = setInterval(function() { tx_simpleslider_pi1_slide(count); }, tx_simpleslider_pi1_conf['slidePause']);

jQuery('#tx-simpleslider-pi1-switcher-' + count).append('<ul />');
var $switcherAnchor = jQuery('#tx-simpleslider-pi1-switcher-' + count);

$switcherAnchor.append('<ul />');
var switcherContent = '<ul>';
for (var i=0; i<items.length; i++) {
if (i == 0)
for (var i = 0; i < items.length; i++) {
if (i == 0) {
switcherContent += '<li class="active"><a href="javascript:tx_simpleslider_pi1_switch(' + count + ', ' + i + ');"></a></li>';
else
} else {
switcherContent += '<li><a href="javascript:tx_simpleslider_pi1_switch(' + count + ', ' + i + ');"></a></li>';
}
}
switcherContent += '</ul>';
jQuery('#tx-simpleslider-pi1-switcher-' + count).html(switcherContent);
$switcherAnchor.html(switcherContent);

}

Expand All @@ -87,16 +90,14 @@ function tx_simpleslider_pi1_slide(slider) {

if (tx_simpleslider_pi1_conf['animation'] == 'fade') {

if (tx_simpleslider_pi1_conf['items'][slider]['currentItem'] == 0)
jQuery('#tx-simpleslider-pi1-slider-' + slider + ' .tx-simpleslider-pi1-item:gt(0)').animate({
'opacity': 0
}, tx_simpleslider_pi1_conf['animationSpeed'], function() {
jQuery(this).css('z-index', 0);
});
else
jQuery('#tx-simpleslider-pi1-slider-' + slider + ' .tx-simpleslider-pi1-item:eq(' + tx_simpleslider_pi1_conf['items'][slider]['currentItem'] + ')').css('z-index', 1).animate({
'opacity': 1
}, tx_simpleslider_pi1_conf['animationSpeed']);
jQuery('#tx-simpleslider-pi1-slider-' + slider + ' .tx-simpleslider-pi1-item:eq(' + tx_simpleslider_pi1_conf['items'][slider]['currentItem'] + ')').css('z-index', 1).animate({
'opacity': 1
}, tx_simpleslider_pi1_conf['animationSpeed']);
jQuery('#tx-simpleslider-pi1-slider-' + slider + ' .tx-simpleslider-pi1-item').not(':eq(' + tx_simpleslider_pi1_conf['items'][slider]['currentItem'] + ')').css('z-index', 1).animate({
'opacity': 0
}, tx_simpleslider_pi1_conf['animationSpeed'], function() {
jQuery(this).css('z-index', 0);
});

}

Expand Down Expand Up @@ -125,11 +126,11 @@ function tx_simpleslider_pi1_switch(slider, slideNum) {

if (tx_simpleslider_pi1_conf['animation'] == 'fade') {

if (slideNum == 0)
if (slideNum == 0) {
jQuery('#tx-simpleslider-pi1-slider-' + slider + ' .tx-simpleslider-pi1-item:gt(0)').css('z-index', 0).animate({
'opacity': 0
}, tx_simpleslider_pi1_conf['animationSpeed']);
else {
} else {
jQuery('#tx-simpleslider-pi1-slider-' + slider + ' .tx-simpleslider-pi1-item:eq(' + slideNum + ')').css('z-index', 1).animate({
'opacity': 1
}, tx_simpleslider_pi1_conf['animationSpeed']);
Expand Down

0 comments on commit d59cb58

Please sign in to comment.