Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
bootstrap
Commits
ac68bc39
Commit
ac68bc39
authored
Jan 08, 2012
by
Mark Otto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.0-wip' of github.com:twitter/bootstrap into 2.0-wip
parents
2c790304
5a33c1b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
17 deletions
+50
-17
docs/javascript.html
docs/javascript.html
+37
-16
js/bootstrap-carousel.js
js/bootstrap-carousel.js
+10
-0
js/bootstrap-dropdown.js
js/bootstrap-dropdown.js
+3
-1
No files found.
docs/javascript.html
View file @
ac68bc39
...
@@ -350,7 +350,7 @@ $('#myModal').on('hidden', function () {
...
@@ -350,7 +350,7 @@ $('#myModal').on('hidden', function () {
<li><a
href=
"#fat"
>
@fat
</a></li>
<li><a
href=
"#fat"
>
@fat
</a></li>
<li><a
href=
"#mdo"
>
@mdo
</a></li>
<li><a
href=
"#mdo"
>
@mdo
</a></li>
<li
class=
"dropdown"
>
<li
class=
"dropdown"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown
</a>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b>
</a>
<ul
class=
"dropdown-menu"
>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#one"
>
one
</a></li>
<li><a
href=
"#one"
>
one
</a></li>
<li><a
href=
"#two"
>
two
</a></li>
<li><a
href=
"#two"
>
two
</a></li>
...
@@ -1046,21 +1046,42 @@ $('#myCollapsible').on('hidden', function () {
...
@@ -1046,21 +1046,42 @@ $('#myCollapsible').on('hidden', function () {
<
/div
>
<
/div
>
</pre>
</pre>
<h3>
Methods
</h3>
<h3>
Methods
</h3>
<h4>
.carousel(options)
</h4>
<h4>
.carousel(options)
</h4>
<p>
Initializes the carousel with an optional options
<code>
object
</code>
and starts cycling through items.
</p>
<p>
Initializes the carousel with an optional options
<code>
object
</code>
and starts cycling through items.
</p>
<pre
class=
"prettyprint linenums"
>
<pre
class=
"prettyprint linenums"
>
$('.myCarousel').carousel({
$('.myCarousel').carousel({
interval: 2000
interval: 2000
})
</pre>
})
</pre>
<h4>
.carousel('cycle')
</h4>
<h4>
.carousel('cycle')
</h4>
<p>
Cycles through the carousel items from left to right.
</p>
<p>
Cycles through the carousel items from left to right.
</p>
<h4>
.carousel('pause')
</h4>
<h4>
.carousel('pause')
</h4>
<p>
Stops the carousel from cycling through items.
</p>
<p>
Stops the carousel from cycling through items.
</p>
<h4>
.carousel('prev')
</h4>
<h4>
.carousel('prev')
</h4>
<p>
Cycles to the previous item.
</p>
<p>
Cycles to the previous item.
</p>
<h4>
.carousel('next')
</h4>
<h4>
.carousel('next')
</h4>
<p>
Cycles to the next item.
</p>
<p>
Cycles to the next item.
</p>
<h3>
Events
</h3>
<p>
Bootstrap's modal class exposes a few events for hooking into modal functionality.
</p>
<table
class=
"bordered-table striped-table"
>
<thead>
<tr>
<th
style=
"width: 150px;"
>
Event
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
slide
</td>
<td>
This event fires immediately when the
<code>
slide
</code>
instance method is invoked.
</td>
</tr>
<tr>
<td>
slid
</td>
<td>
This event is fired when the carousel has completed it's slide transition.
</td>
</tr>
</tr>
</tbody>
</table>
<h3>
Demo
</h3>
<h3>
Demo
</h3>
<!-- carousel -->
<!-- carousel -->
...
...
js/bootstrap-carousel.js
View file @
ac68bc39
...
@@ -44,10 +44,12 @@
...
@@ -44,10 +44,12 @@
}
}
,
next
:
function
()
{
,
next
:
function
()
{
if
(
this
.
sliding
)
return
return
this
.
slide
(
'
next
'
)
return
this
.
slide
(
'
next
'
)
}
}
,
prev
:
function
()
{
,
prev
:
function
()
{
if
(
this
.
sliding
)
return
return
this
.
slide
(
'
prev
'
)
return
this
.
slide
(
'
prev
'
)
}
}
...
@@ -59,21 +61,29 @@
...
@@ -59,21 +61,29 @@
,
fallback
=
type
==
'
next
'
?
'
first
'
:
'
last
'
,
fallback
=
type
==
'
next
'
?
'
first
'
:
'
last
'
,
that
=
this
,
that
=
this
this
.
sliding
=
true
isCycling
&&
this
.
pause
()
isCycling
&&
this
.
pause
()
$next
=
$next
.
length
?
$next
:
this
.
$element
.
find
(
'
.item
'
)[
fallback
]()
$next
=
$next
.
length
?
$next
:
this
.
$element
.
find
(
'
.item
'
)[
fallback
]()
if
(
!
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
if
(
!
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
slide
'
))
{
this
.
$element
.
trigger
(
'
slide
'
)
$active
.
removeClass
(
'
active
'
)
$active
.
removeClass
(
'
active
'
)
$next
.
addClass
(
'
active
'
)
$next
.
addClass
(
'
active
'
)
this
.
$element
.
trigger
(
'
slid
'
)
this
.
sliding
=
false
}
else
{
}
else
{
$next
.
addClass
(
type
)
$next
.
addClass
(
type
)
$next
[
0
].
offsetWidth
// force reflow
$next
[
0
].
offsetWidth
// force reflow
$active
.
addClass
(
direction
)
$active
.
addClass
(
direction
)
$next
.
addClass
(
direction
)
$next
.
addClass
(
direction
)
this
.
$element
.
trigger
(
'
slide
'
)
this
.
$element
.
one
(
$
.
support
.
transition
.
end
,
function
()
{
this
.
$element
.
one
(
$
.
support
.
transition
.
end
,
function
()
{
$next
.
removeClass
([
type
,
direction
].
join
(
'
'
)).
addClass
(
'
active
'
)
$next
.
removeClass
([
type
,
direction
].
join
(
'
'
)).
addClass
(
'
active
'
)
$active
.
removeClass
([
'
active
'
,
direction
].
join
(
'
'
))
$active
.
removeClass
([
'
active
'
,
direction
].
join
(
'
'
))
that
.
$element
.
trigger
(
'
slid
'
)
that
.
sliding
=
false
})
})
}
}
...
...
js/bootstrap-dropdown.js
View file @
ac68bc39
...
@@ -38,12 +38,14 @@
...
@@ -38,12 +38,14 @@
var
$this
=
$
(
this
)
var
$this
=
$
(
this
)
,
selector
=
$this
.
attr
(
'
data-target
'
)
||
$this
.
attr
(
'
href
'
)
,
selector
=
$this
.
attr
(
'
data-target
'
)
||
$this
.
attr
(
'
href
'
)
,
$parent
=
$
(
selector
)
,
$parent
=
$
(
selector
)
,
isActive
$parent
.
length
||
(
$parent
=
$this
.
parent
())
$parent
.
length
||
(
$parent
=
$this
.
parent
())
isActive
=
$parent
.
hasClass
(
'
open
'
)
clearMenus
()
clearMenus
()
!
$parent
.
hasClass
(
'
open
'
)
&&
$parent
.
toggleClass
(
'
open
'
)
!
isActive
&&
$parent
.
toggleClass
(
'
open
'
)
return
false
return
false
}
}
...
...
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