Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
I
i20rzslider
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jedife
i20rzslider
Commits
3aa77c5d
Commit
3aa77c5d
authored
Oct 16, 2015
by
Valentin Hervieu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ticks values when step is a float.
parent
fef8c8b4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
11 deletions
+15
-11
index.html
demo/index.html
+6
-4
rzslider.js
dist/rzslider.js
+3
-2
rzslider.min.css
dist/rzslider.min.css
+1
-1
rzslider.min.js
dist/rzslider.min.js
+2
-2
rzslider.js
src/rzslider.js
+3
-2
No files found.
demo/index.html
View file @
3aa77c5d
...
...
@@ -107,15 +107,17 @@
<h2>
Slider with ticks value and visible bar example
</h2>
Value: {{ priceSlider6 | json }}
<rzslider
rz-slider-model=
"priceSlider6"
rz-slider-floor=
"0"
rz-slider-ceil=
"10"
rz-slider-floor=
"0.5"
rz-slider-ceil=
"1.5"
rz-slider-step=
"0.1"
rz-slider-precision=
"1"
rz-slider-always-show-bar=
"true"
rz-slider-show-ticks-value=
"true"
></rzslider>
</article>
<article>
<h2>
Range Slider with ticks value example
</h2>
Value: {{ priceSlider
6
| json }}
Value: {{ priceSlider
7
| json }}
<rzslider
rz-slider-model=
"priceSlider7.min"
rz-slider-high=
"priceSlider7.max"
rz-slider-floor=
"0"
...
...
@@ -180,7 +182,7 @@
$scope
.
priceSlider3
=
250
;
$scope
.
priceSlider4
=
5
;
$scope
.
priceSlider5
=
5
;
$scope
.
priceSlider6
=
5
;
$scope
.
priceSlider6
=
1
;
$scope
.
priceSlider7
=
{
min
:
2
,
max
:
8
...
...
dist/rzslider.js
View file @
3aa77c5d
...
...
@@ -680,10 +680,11 @@ function throttle(func, wait, options) {
var
positions
=
''
,
ticksCount
=
Math
.
round
((
this
.
maxValue
-
this
.
minValue
)
/
this
.
step
)
+
1
;
for
(
var
i
=
0
;
i
<
ticksCount
;
i
++
)
{
var
selectedClass
=
this
.
isTickSelected
(
i
)
?
'selected'
:
''
;
var
value
=
this
.
roundStep
(
this
.
minValue
+
i
*
this
.
step
);
var
selectedClass
=
this
.
isTickSelected
(
value
)
?
'selected'
:
''
;
positions
+=
'<li class="tick '
+
selectedClass
+
'">'
;
if
(
this
.
showTicksValue
)
positions
+=
'<span class="tick-value">'
+
this
.
getDisplayValue
(
i
)
+
'</span>'
;
positions
+=
'<span class="tick-value">'
+
this
.
getDisplayValue
(
value
)
+
'</span>'
;
positions
+=
'</li>'
;
}
this
.
ticks
.
html
(
positions
);
...
...
dist/rzslider.min.css
View file @
3aa77c5d
/*! angularjs-slider - v1.0.0 - (c) Rafal Zajac <rzajac@gmail.com>, Valentin Hervieu <valentin@hervieu.me>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com>, https://github.com/rzajac/angularjs-slider.git - 2015-10-1
5
*/
/*! angularjs-slider - v1.0.0 - (c) Rafal Zajac <rzajac@gmail.com>, Valentin Hervieu <valentin@hervieu.me>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com>, https://github.com/rzajac/angularjs-slider.git - 2015-10-1
6
*/
rzslider
{
position
:
relative
;
display
:
inline-block
;
width
:
100%
;
height
:
4px
;
margin
:
30px
0
15px
0
;
vertical-align
:
middle
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
}
rzslider
[
disabled
]
{
cursor
:
not-allowed
}
rzslider
[
disabled
]
span
.rz-pointer
{
cursor
:
not-allowed
;
background-color
:
#d8e0f3
}
rzslider
span
{
position
:
absolute
;
display
:
inline-block
;
white-space
:
nowrap
}
rzslider
span
.rz-base
{
width
:
100%
;
height
:
100%
;
padding
:
0
}
rzslider
span
.rz-bar-wrapper
{
left
:
0
;
z-index
:
1
;
width
:
100%
;
height
:
32px
;
padding-top
:
16px
;
margin-top
:
-16px
;
box-sizing
:
border-box
}
rzslider
span
.rz-bar
{
left
:
0
;
z-index
:
1
;
width
:
100%
;
height
:
4px
;
background
:
#d8e0f3
;
-webkit-border-radius
:
2px
;
-moz-border-radius
:
2px
;
border-radius
:
2px
}
rzslider
span
.rz-bar.rz-selection
{
z-index
:
2
;
background
:
#0db9f0
;
-webkit-border-radius
:
2px
;
-moz-border-radius
:
2px
;
border-radius
:
2px
}
rzslider
span
.rz-pointer
{
top
:
-14px
;
z-index
:
3
;
width
:
32px
;
height
:
32px
;
cursor
:
pointer
;
background-color
:
#0db9f0
;
-webkit-border-radius
:
16px
;
-moz-border-radius
:
16px
;
border-radius
:
16px
}
rzslider
span
.rz-pointer
:after
{
position
:
absolute
;
top
:
12px
;
left
:
12px
;
width
:
8px
;
height
:
8px
;
background
:
#fff
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;
content
:
''
}
rzslider
span
.rz-pointer
:hover:after
{
background-color
:
#fff
}
rzslider
span
.rz-pointer.rz-active
:after
{
background-color
:
#451aff
}
rzslider
span
.rz-bubble
{
bottom
:
16px
;
padding
:
1px
3px
;
color
:
#55637d
;
cursor
:
default
}
rzslider
span
.rz-bubble.rz-selection
{
top
:
16px
}
rzslider
span
.rz-bubble.rz-limit
{
color
:
#55637d
}
rzslider
.rz-ticks
{
position
:
absolute
;
top
:
-3px
;
left
:
0
;
z-index
:
1
;
display
:
flex
;
width
:
100%
;
padding
:
0
11px
;
margin
:
0
;
list-style
:
none
;
box-sizing
:
border-box
;
justify-content
:
space-between
}
rzslider
.rz-ticks
.tick
{
width
:
10px
;
height
:
10px
;
text-align
:
center
;
cursor
:
pointer
;
background
:
#d8e0f3
;
border-radius
:
50%
}
rzslider
.rz-ticks
.tick.selected
{
background
:
#0db9f0
}
rzslider
.rz-ticks
.tick
.tick-value
{
position
:
absolute
;
top
:
-30px
;
transform
:
translate
(
-50%
,
0
)}
\ No newline at end of file
dist/rzslider.min.js
View file @
3aa77c5d
This diff is collapsed.
Click to expand it.
src/rzslider.js
View file @
3aa77c5d
...
...
@@ -680,10 +680,11 @@ function throttle(func, wait, options) {
var
positions
=
''
,
ticksCount
=
Math
.
round
((
this
.
maxValue
-
this
.
minValue
)
/
this
.
step
)
+
1
;
for
(
var
i
=
0
;
i
<
ticksCount
;
i
++
)
{
var
selectedClass
=
this
.
isTickSelected
(
i
)
?
'selected'
:
''
;
var
value
=
this
.
roundStep
(
this
.
minValue
+
i
*
this
.
step
);
var
selectedClass
=
this
.
isTickSelected
(
value
)
?
'selected'
:
''
;
positions
+=
'<li class="tick '
+
selectedClass
+
'">'
;
if
(
this
.
showTicksValue
)
positions
+=
'<span class="tick-value">'
+
this
.
getDisplayValue
(
i
)
+
'</span>'
;
positions
+=
'<span class="tick-value">'
+
this
.
getDisplayValue
(
value
)
+
'</span>'
;
positions
+=
'</li>'
;
}
this
.
ticks
.
html
(
positions
);
...
...
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