Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PSW2-D3TI01
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Julius Samosir
PSW2-D3TI01
Commits
86b7f11e
Commit
86b7f11e
authored
Jun 06, 2020
by
Julius Samosir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
62013510
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
bootstrap-touch-slider.js
js/bootstrap-touch-slider.js
+55
-0
No files found.
js/bootstrap-touch-slider.js
0 → 100644
View file @
86b7f11e
/*Bootstrap Carousel Touch Slider.
http://bootstrapthemes.co
Credits: Bootstrap, jQuery, TouchSwipe, Animate.css, FontAwesome
*/
(
function
(
$
)
{
"use strict"
;
$
.
fn
.
bsTouchSlider
=
function
(
options
)
{
var
carousel
=
$
(
".carousel"
);
return
this
.
each
(
function
(
)
{
function
doAnimations
(
elems
)
{
//Cache the animationend event in a variable
var
animEndEv
=
'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'
;
elems
.
each
(
function
(
)
{
var
$this
=
$
(
this
),
$animationType
=
$this
.
data
(
'animation'
);
$this
.
addClass
(
$animationType
).
one
(
animEndEv
,
function
(
)
{
$this
.
removeClass
(
$animationType
);
}
);
}
);
}
//Variables on page load
var
$firstAnimatingElems
=
carousel
.
find
(
'.item:first'
).
find
(
"[data-animation ^= 'animated']"
);
//Initialize carousel
carousel
.
carousel
(
);
//Animate captions in first slide on page load
doAnimations
(
$firstAnimatingElems
);
//Other slides to be animated on carousel slide event
carousel
.
on
(
'slide.bs.carousel'
,
function
(
e
)
{
var
$animatingElems
=
$
(
e
.
relatedTarget
).
find
(
"[data-animation ^= 'animated']"
);
doAnimations
(
$animatingElems
);
}
);
//swipe initial
$
(
".carousel .carousel-inner"
).
swipe
(
{
swipeLeft
:
function
(
event
,
direction
,
distance
,
duration
,
fingerCount
)
{
this
.
parent
(
).
carousel
(
'next'
);
},
swipeRight
:
function
(
)
{
this
.
parent
(
).
carousel
(
'prev'
);
},
threshold
:
0
}
);
}
);
};
}
)(
jQuery
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment