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
a5b5e94b
Commit
a5b5e94b
authored
Sep 26, 2019
by
Adarsh K
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'abraham' into 'master'
slidechange See merge request
!4
parents
04e55605
726373b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
carousel.component.ts
src/app/home/carousel/carousel.component.ts
+3
-1
carousel.html
src/app/home/carousel/carousel.html
+2
-2
carousel.scss
src/app/home/carousel/carousel.scss
+9
-0
No files found.
src/app/home/carousel/carousel.component.ts
View file @
a5b5e94b
...
@@ -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 @
a5b5e94b
<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>
</section>
</section>
...
...
src/app/home/carousel/carousel.scss
View file @
a5b5e94b
...
@@ -7,4 +7,12 @@
...
@@ -7,4 +7,12 @@
width
:
auto
;
width
:
auto
;
}
}
}
}
}
.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