Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ati
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
amal
ati
Commits
726373b5
Commit
726373b5
authored
Sep 26, 2019
by
abraham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slidechange
parent
04e55605
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
carousel.component.ts
src/app/home/carousel/carousel.component.ts
+3
-1
carousel.html
src/app/home/carousel/carousel.html
+1
-1
carousel.scss
src/app/home/carousel/carousel.scss
+9
-0
No files found.
src/app/home/carousel/carousel.component.ts
View file @
726373b5
...
@@ -27,8 +27,10 @@ export class CarouselComponent implements AfterViewInit {
...
@@ -27,8 +27,10 @@ export class CarouselComponent implements AfterViewInit {
next
()
{
next
()
{
if
(
this
.
currentSlide
+
1
===
this
.
items
.
length
)
return
;
if
(
this
.
currentSlide
+
1
===
this
.
items
.
length
)
return
;
console
.
log
(
this
.
items
);
console
.
log
(
this
.
itemWidth
);
this
.
currentSlide
=
(
this
.
currentSlide
+
1
)
%
this
.
items
.
length
;
this
.
currentSlide
=
(
this
.
currentSlide
+
1
)
%
this
.
items
.
length
;
const
offset
=
this
.
currentSlide
*
this
.
itemWidth
;
const
offset
=
this
.
currentSlide
*
404
;
const
myAnimation
:
AnimationFactory
=
this
.
buildAnimation
(
offset
);
const
myAnimation
:
AnimationFactory
=
this
.
buildAnimation
(
offset
);
this
.
player
=
myAnimation
.
create
(
this
.
carousel
.
nativeElement
);
this
.
player
=
myAnimation
.
create
(
this
.
carousel
.
nativeElement
);
this
.
player
.
play
();
this
.
player
.
play
();
...
...
src/app/home/carousel/carousel.html
View file @
726373b5
<section
class=
"carousel-wrapper"
[
ngStyle
]="
carouselWrapperStyle
"
>
<section
class=
"carousel-wrapper"
[
ngStyle
]="
carouselWrapperStyle
"
>
<ul
class=
"carousel-inner"
#
carousel
>
<ul
class=
"carousel-inner"
#
carousel
>
<li
*
ngFor=
"let item of items;"
class=
"carousel-item"
>
<li
*
ngFor=
"let item of items;"
class=
"carousel-item"
>
<ng-container
[
ngTemplateOutlet
]="
item
.
tpl
"
></ng-container>
<ng-container
[
ngTemplateOutlet
]="
item
.
tpl
"
></ng-container>
</li>
</li>
</ul>
</ul>
...
...
src/app/home/carousel/carousel.scss
View file @
726373b5
...
@@ -8,3 +8,11 @@
...
@@ -8,3 +8,11 @@
}
}
}
}
}
}
.carousel-inner
{
display
:
flex
;
width
:
max-content
;
.carousel-item
{
width
:
404px
!
important
;
}
}
\ No newline at end of file
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