Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
7ec6c9fd
Commit
7ec6c9fd
authored
10 years ago
by
Mark Otto
Browse files
Options
Download
Email Patches
Plain Diff
Fixes
#14116
: Use <button> elements over empty anchors
parent
bd292ca3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/_includes/js/dropdowns.html
+32
-10
docs/_includes/js/dropdowns.html
with
32 additions
and
10 deletions
+32
-10
docs/_includes/js/dropdowns.html
+
32
-
10
View file @
7ec6c9fd
...
@@ -20,7 +20,10 @@
...
@@ -20,7 +20,10 @@
<div
class=
"collapse navbar-collapse bs-example-js-navbar-collapse"
>
<div
class=
"collapse navbar-collapse bs-example-js-navbar-collapse"
>
<ul
class=
"nav navbar-nav"
>
<ul
class=
"nav navbar-nav"
>
<li
class=
"dropdown"
>
<li
class=
"dropdown"
>
<a
id=
"drop1"
href=
"#"
role=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown
<span
class=
"caret"
></span></a>
<button
id=
"drop1"
type=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown
<span
class=
"caret"
></span>
</button>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop1"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop1"
>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
...
@@ -30,7 +33,10 @@
...
@@ -30,7 +33,10 @@
</ul>
</ul>
</li>
</li>
<li
class=
"dropdown"
>
<li
class=
"dropdown"
>
<a
href=
"#"
id=
"drop2"
role=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown 2
<span
class=
"caret"
></span></a>
<button
id=
"drop2"
type=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown 2
<span
class=
"caret"
></span>
</button>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop2"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop2"
>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
...
@@ -42,7 +48,10 @@
...
@@ -42,7 +48,10 @@
</ul>
</ul>
<ul
class=
"nav navbar-nav navbar-right"
>
<ul
class=
"nav navbar-nav navbar-right"
>
<li
id=
"fat-menu"
class=
"dropdown"
>
<li
id=
"fat-menu"
class=
"dropdown"
>
<a
href=
"#"
id=
"drop3"
role=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown 3
<span
class=
"caret"
></span></a>
<button
id=
"drop3"
type=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown 3
<span
class=
"caret"
></span>
</button>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop3"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop3"
>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
...
@@ -62,7 +71,10 @@
...
@@ -62,7 +71,10 @@
<ul
class=
"nav nav-pills"
role=
"tablist"
>
<ul
class=
"nav nav-pills"
role=
"tablist"
>
<li
role=
"presentation"
class=
"active"
><a
href=
"#"
>
Regular link
</a></li>
<li
role=
"presentation"
class=
"active"
><a
href=
"#"
>
Regular link
</a></li>
<li
role=
"presentation"
class=
"dropdown"
>
<li
role=
"presentation"
class=
"dropdown"
>
<a
id=
"drop4"
role=
"button"
data-toggle=
"dropdown"
href=
"#"
>
Dropdown
<span
class=
"caret"
></span></a>
<button
id=
"drop4"
type=
"button"
data-toggle=
"dropdown"
>
Dropdown
<span
class=
"caret"
></span>
</button>
<ul
id=
"menu1"
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop4"
>
<ul
id=
"menu1"
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop4"
>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
...
@@ -72,7 +84,10 @@
...
@@ -72,7 +84,10 @@
</ul>
</ul>
</li>
</li>
<li
role=
"presentation"
class=
"dropdown"
>
<li
role=
"presentation"
class=
"dropdown"
>
<a
id=
"drop5"
role=
"button"
data-toggle=
"dropdown"
href=
"#"
>
Dropdown 2
<span
class=
"caret"
></span></a>
<button
id=
"drop5"
type=
"button"
data-toggle=
"dropdown"
>
Dropdown 2
<span
class=
"caret"
></span>
</button>
<ul
id=
"menu2"
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop5"
>
<ul
id=
"menu2"
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop5"
>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
...
@@ -82,7 +97,10 @@
...
@@ -82,7 +97,10 @@
</ul>
</ul>
</li>
</li>
<li
role=
"presentation"
class=
"dropdown"
>
<li
role=
"presentation"
class=
"dropdown"
>
<a
id=
"drop6"
role=
"button"
data-toggle=
"dropdown"
href=
"#"
>
Dropdown 3
<span
class=
"caret"
></span></a>
<button
id=
"drop6"
type=
"button"
data-toggle=
"dropdown"
>
Dropdown 3
<span
class=
"caret"
></span>
</button>
<ul
id=
"menu3"
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop6"
>
<ul
id=
"menu3"
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop6"
>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"http://twitter.com/fat"
>
Another action
</a></li>
...
@@ -104,7 +122,10 @@
...
@@ -104,7 +122,10 @@
<p>
Add
<code>
data-toggle="dropdown"
</code>
to a link or button to toggle a dropdown.
</p>
<p>
Add
<code>
data-toggle="dropdown"
</code>
to a link or button to toggle a dropdown.
</p>
{% highlight html %}
{% highlight html %}
<div
class=
"dropdown"
>
<div
class=
"dropdown"
>
<a
id=
"dLabel"
role=
"button"
data-toggle=
"dropdown"
href=
"#"
>
Dropdown trigger
</a>
<button
id=
"dLabel"
type=
"button"
data-toggle=
"dropdown"
>
Dropdown trigger
<span
class=
"caret"
></span>
</button>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"dLabel"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"dLabel"
>
...
...
</ul>
</ul>
...
@@ -113,9 +134,10 @@
...
@@ -113,9 +134,10 @@
<p>
To keep URLs intact, use the
<code>
data-target
</code>
attribute instead of
<code>
href="#"
</code>
.
</p>
<p>
To keep URLs intact, use the
<code>
data-target
</code>
attribute instead of
<code>
href="#"
</code>
.
</p>
{% highlight html %}
{% highlight html %}
<div
class=
"dropdown"
>
<div
class=
"dropdown"
>
<a
id=
"dLabel"
role=
"button"
data-toggle=
"dropdown"
data-target=
"#"
href=
"/page.html"
>
<button
id=
"dLabel"
type=
"button"
data-toggle=
"dropdown"
>
Dropdown trigger
</button>
Dropdown
<span
class=
"caret"
></span>
Dropdown
</a>
<span
class=
"caret"
></span>
</button>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"dLabel"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"dLabel"
>
...
...
...
...
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
Menu
Explore
Projects
Groups
Snippets