-
Notifications
You must be signed in to change notification settings - Fork 89
tab选项卡 第一阶段 #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chaihongjun
wants to merge
2
commits into
nimoc:gh-pages
Choose a base branch
from
chaihongjun:gh-pages
base: gh-pages
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
tab选项卡 第一阶段 #62
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="cmn-hans"> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"> | ||
| <meta name="renderer" content="webkit"> | ||
| <meta name=applicable-device content="pc,mobile"> | ||
| <!-- some meta tags, important for SEO"--> | ||
| <meta name="description" content="put a short description in here" /> | ||
| <meta name="keywords" content="put your important keywords in here" /> | ||
| <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | ||
| <style type="text/css"> | ||
| .modal { | ||
| display: none; | ||
| } | ||
| .modal-dialog { | ||
| width: 500px; | ||
| border: 5px solid #4f4f4f; | ||
| } | ||
| .modal-content { | ||
| height: 200px; | ||
| border-radius: 0; | ||
| } | ||
| .modal-backdrop{ | ||
| z-index: -99999; | ||
| } | ||
|
|
||
| </style> | ||
| <script> | ||
| window.onload = function() { | ||
| var btn = document.getElementsByTagName('a')[0]; | ||
| var modal = document.getElementById('modal-id'); | ||
| var close=document.getElementsByTagName('button')[0]; | ||
| var mask = document.getElementsByClassName('modal-backdrop')[0]; | ||
| btn.onclick = function() { | ||
| modal.style.display = 'block'; | ||
| modal.className = 'modal fade in'; | ||
| mask.className = "modal-backdrop fade in"; | ||
| }; | ||
| close.onclick=function(){ | ||
| modal.style.display = 'none'; | ||
| modal.className = 'modal fade'; | ||
| mask.className = "modal-backdrop fade"; | ||
| }; | ||
| }; | ||
| </script> | ||
| <title>Dialog 弹出层</title> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <a class="btn btn-primary" data-toggle="modal" href='#modal-id'>Trigger modal</a> | ||
| <div class="modal fade" id="modal-id"> | ||
| <div class="modal-dialog"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
| <h4 class="modal-title">我真是标题啊</h4> | ||
| </div> | ||
| <div class="modal-body"> | ||
| 我是内容 我是内容 | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="modal-backdrop fade"></div> | ||
| </div> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="cmn-hans"> | ||
|
|
||
| <head> | ||
| <meta charset="utf-8"> | ||
| <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"> | ||
| <meta name="renderer" content="webkit"> | ||
| <meta name=applicable-device content="pc,mobile"> | ||
| <!-- some meta tags, important for SEO"--> | ||
| <meta name="description" content="put a short description in here" /> | ||
| <meta name="keywords" content="put your important keywords in here" /> | ||
| <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | ||
| <title>选项卡-第一阶段</title> | ||
| <style type="text/css"> | ||
| .container { | ||
| width: 400px; | ||
| text-align: left; | ||
| } | ||
|
|
||
| .tab-content { | ||
| padding: 5px; | ||
| } | ||
| </style> | ||
| <script> | ||
| window.onload = function() { | ||
| var tabs = document.getElementsByTagName('li'); | ||
| var contents = document.getElementsByClassName('tab-pane'); | ||
| for (var i = 0; i < tabs.length; i++) { | ||
|
|
||
| tabs[i].onclick = function() { | ||
| //单击任意tab的时候,先初始化全部不active | ||
| for (var i = 0; i < tabs.length; i++) { | ||
| tabs[i].index = i; | ||
| tabs[i].className = ''; | ||
| contents[i].className = 'tab-pane'; | ||
|
|
||
| } | ||
| //接着,active点击的tab和对应的content | ||
| tabs[this.index].className = 'active'; | ||
| contents[this.index].className = 'tab-pane active'; | ||
| }; | ||
| } | ||
| }; | ||
| </script> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div class="container"> | ||
| <div role="tabpanel"> | ||
| <!-- Nav tabs --> | ||
| <ul class="nav nav-tabs" role="tablist"> | ||
| <li role="presentation" class="active"> | ||
| <a href="#home" aria-controls="home" role="tab" data-toggle="tab">home</a> | ||
| </li> | ||
| <li role="presentation"> | ||
| <a href="#profile" aria-controls="tab" role="tab" data-toggle="tab">Profile</a> | ||
| </li> | ||
| <li role="presentation"> | ||
| <a href="#demo" aria-controls="tab" role="tab" data-toggle="tab">Demo</a> | ||
| </li> | ||
| </ul> | ||
| <!-- Tab panes --> | ||
| <div class="tab-content"> | ||
| <div role="tabpanel" class="tab-pane active" id="home">离离原上草,一岁一枯荣。 野火烧不尽,春风吹又生。 远芳侵古道,晴翠接荒城。 又送王孙去,萋萋满别情。 | ||
| </div> | ||
| <div role="tabpanel" class="tab-pane" id="profile"> | ||
| 野火烧不尽,春风吹又生。 离离原上草,一岁一枯荣。 远芳侵古道,晴翠接荒城。 又送王孙去,萋萋满别情。 | ||
| </div> | ||
| <div role="tabpanel" class="tab-pane" id="profile"> | ||
| 远芳侵古道,晴翠接荒城。 离离原上草,一岁一枯荣。 野火烧不尽,春风吹又生。 又送王孙去,萋萋满别情。 | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </body> | ||
|
|
||
| </html> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
个人建议这里的
var i跟外面的别一样, 可以: