Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
open-source
hacklab-blocks
Commits
c1dba53e
Commit
c1dba53e
authored
2 years ago
by
everaldomatias
Browse files
Options
Download
Email Patches
Plain Diff
Remove width slider of the JS and add on CSS
parent
8c6e54c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
12 deletions
+5
-12
blocks/featured-slider/front.js
blocks/featured-slider/front.js
+1
-12
blocks/featured-slider/style.scss
blocks/featured-slider/style.scss
+4
-0
No files found.
blocks/featured-slider/front.js
View file @
c1dba53e
...
...
@@ -7,17 +7,7 @@ let sliders = [];
let
i
=
1
;
document
.
querySelectorAll
(
'
.featured-slider .itens-wrapper
'
).
forEach
(
(
element
)
=>
{
let
width
=
element
.
clientWidth
;
console
.
log
(
element
.
childElementCount
)
document
.
head
.
insertAdjacentHTML
(
'
beforeend
'
,
`<style>
#tns
${
i
}
> .tns-item {
width:
${
width
}
px !important;
}
</style>`
);
if
(
element
.
childElementCount
>=
2
)
{
sliders
[
i
]
=
tns
({
container
:
element
,
items
:
1
,
...
...
@@ -26,12 +16,11 @@ document.querySelectorAll( '.featured-slider .itens-wrapper' ).forEach( (element
controlsText
:
[
'
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="none" stroke="#626262" stroke-width="2" d="M15 6l-6 6l6 6"/></svg>
'
,
'
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="none" stroke="#626262" stroke-width="2" d="M9 6l6 6l-6 6"/></svg>
'
],
slideBy
:
'
page
'
,
mouseDrag
:
true
,
fixedWidth
:
element
.
clientWidth
,
fixedWidth
:
1980
,
mode
:
'
gallery
'
,
animateDelay
:
800
,
speed
:
800
,
});
}
i
++
;
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
blocks/featured-slider/style.scss
View file @
c1dba53e
...
...
@@ -175,6 +175,10 @@
.tns-outer
{
position
:
relative
;
.tns-slider
>
.tns-item
{
width
:
100%
!
important
;
}
.tns-controls
{
position
:
initial
;
...
...
This diff is collapsed.
Click to expand it.
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