Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
9ac3fe6f
Commit
9ac3fe6f
authored
10 years ago
by
Mark Otto
Browse files
Options
Download
Plain Diff
Merge branch 'master' of github.com:twbs/bootstrap
parents
c7783f5a
6a248244
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/carousel.js
+6
-10
js/carousel.js
with
6 additions
and
10 deletions
+6
-10
js/carousel.js
+
6
-
10
View file @
9ac3fe6f
...
@@ -48,16 +48,14 @@
...
@@ -48,16 +48,14 @@
return
this
return
this
}
}
Carousel
.
prototype
.
getActiveIndex
=
function
()
{
Carousel
.
prototype
.
getItemIndex
=
function
(
item
)
{
this
.
$active
=
this
.
$element
.
find
(
'
.item.active
'
)
this
.
$items
=
item
.
parent
().
children
(
'
.item
'
)
this
.
$items
=
this
.
$active
.
parent
().
children
(
'
.item
'
)
return
this
.
$items
.
index
(
item
||
this
.
$active
)
return
this
.
$items
.
index
(
this
.
$active
)
}
}
Carousel
.
prototype
.
to
=
function
(
pos
)
{
Carousel
.
prototype
.
to
=
function
(
pos
)
{
var
that
=
this
var
that
=
this
var
activeIndex
=
this
.
get
ActiveIndex
(
)
var
activeIndex
=
this
.
get
ItemIndex
(
this
.
$active
=
this
.
$element
.
find
(
'
.item.active
'
)
)
if
(
pos
>
(
this
.
$items
.
length
-
1
)
||
pos
<
0
)
return
if
(
pos
>
(
this
.
$items
.
length
-
1
)
||
pos
<
0
)
return
...
@@ -119,10 +117,8 @@
...
@@ -119,10 +117,8 @@
if
(
this
.
$indicators
.
length
)
{
if
(
this
.
$indicators
.
length
)
{
this
.
$indicators
.
find
(
'
.active
'
).
removeClass
(
'
active
'
)
this
.
$indicators
.
find
(
'
.active
'
).
removeClass
(
'
active
'
)
this
.
$element
.
one
(
'
slid.bs.carousel
'
,
function
()
{
// yes, "slid"
var
$nextIndicator
=
$
(
this
.
$indicators
.
children
()[
this
.
getItemIndex
(
$next
)])
var
$nextIndicator
=
$
(
that
.
$indicators
.
children
()[
that
.
getActiveIndex
()])
$nextIndicator
&&
$nextIndicator
.
addClass
(
'
active
'
)
$nextIndicator
&&
$nextIndicator
.
addClass
(
'
active
'
)
})
}
}
var
slidEvent
=
$
.
Event
(
'
slid.bs.carousel
'
,
{
relatedTarget
:
relatedTarget
,
direction
:
direction
})
// yes, "slid"
var
slidEvent
=
$
.
Event
(
'
slid.bs.carousel
'
,
{
relatedTarget
:
relatedTarget
,
direction
:
direction
})
// yes, "slid"
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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