[code]
<style>
/* Style the tab */
.tab {
overflow: hidden;
border: 1px solid #ccc;
background-color: #f2e6ff;
padding-left: 10px;
padding-right: 10px;
}
/* Style the buttons inside the tab */
.tab button {
background-color: inherit;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 14px 16px;
transition: 0.3s;
font-size: 17px;
width:33.3%;
}
/* Change background color of buttons on hover */
.tab button:hover {
background-color: #ddd;
}
/* Create an active/current tablink class */
.tab button.active {
background-color: #ccc;
}
/* Style the tab content */
.tabcontent {
display: none;
padding: 6px 12px;
border: 1px solid #ccc;
border-top: none;
}
/* Style the close button */
.topright {
float: right;
cursor: pointer;
font-size: 28px;
}
.topright:hover {color: red;}
#div_kim{ padding: 15px;}
.h3_kim{ font-size: 15px;}
</style>
<div id="div_kim">
<h3 class="h3_kim">Here is Kims Work !!</h3>
<p>Click on the x button in the top right corner to close the current tab:</p>
</div>
<div class="tab">
<button class="tablinks" onclick="openCity(event, 'London')" id="defaultOpen">영상제작</button>
<button class="tablinks" onclick="openCity(event, 'Paris')">홈페이지</button>
<button class="tablinks" onclick="openCity(event, 'Tokyo')">쇼핑몰</button>
</div>
<div id="London" class="tabcontent">
<span onclick="this.parentElement.style.display='none'" class="topright">×</span>
<h3 class="h3_kim">Make Video</h3>
<p>London is the capital city of England.</p>
<img src="../zz/images/changduk.jpg" style="width:100%;">
</div>
<div id="Paris" class="tabcontent">
<span onclick="this.parentElement.style.display='none'" class="topright">×</span>
<h3 class="h3_kim">Make Homepage</h3>
<p>Paris is the capital of France.</p> <br>
<style>
#mediaPlayer { position:relative; padding-bottom:56.25%; height:0px; overflow:hidden; max-width:100%; }
.normalPlayer { position:absolute; top:0px; left:0px; width:100%; height:100%; display:block; }
</style>
<div id=mediaPlayer><iframe class=normalPlayer src=https://www.youtube.com/embed/zhhEY86_ZXA?autoplay=1 frameborder=0 allowfullscreen></iframe></div>
</div>
<div id="Tokyo" class="tabcontent">
<span onclick="this.parentElement.style.display='none'" class="topright">×</span>
<h3>Make Shoppingmall</h3>
<script>
img_1= "http://egis.kr/zz/images/square/333_1.png";
img_2= "http://egis.kr/zz/images/square/333_2.png";
img_3= "http://egis.kr/zz/images/square/333_3.png";
for(imgTotal=0; this['img_'+(imgTotal+1)]; imgTotal++);
n=1;
function imgGo(){
imgBtn.src= this["img_"+(n= n== imgTotal ? 1 : n+1)];
imgOrder.innerText=n;
}
</script>
<img id=imgBtn style=cursor:pointer;width:100% src=http://egis.kr/zz/images/square/333_1.png onclick=imgGo()>
<div id=imgOrder style=text-align:center;font-size:20px>1</div>
</div>
<script>
function openCity(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
// Get the element with id="defaultOpen" and click on it
document.getElementById("defaultOpen").click();
</script>
<!-- tabs end -->
[/code]
원소스는 How To Create Tabs (w3schools.com)이며 css를 약간 추가하였습니다.
mobile index.php에 넣으시면 됩니다
감사합니다.
댓글 6개
게시글 목록
| 번호 | 제목 |
|---|---|
| 17316 | |
| 17315 |
JavaScript
시계 스크립트 그런데 페이지 뜨는건 느린게 문제네...
|
| 17313 |
PHP
php 업로드 소스
4
|
| 17312 | |
| 17305 | |
| 17304 | |
| 17298 |
node.js
간단한 채팅
|
| 17294 | |
| 17291 | |
| 17285 | |
| 17284 |
JavaScript
두가지 형태의 페이지 로딩 [ 로딩중, 로딩 프로그레스바 ]
2
|
| 17279 | |
| 17272 | |
| 17271 |
JavaScript
관계에 따른 메뉴 구성방안
1
|
| 17270 | |
| 17262 | |
| 17255 | |
| 17248 |
JavaScript
엘레먼트 요소에서 data 를 이벤트 핸들러로 사용하기
4
|
| 17241 | |
| 17238 |
MySQL
interval에 쓸 수 있는 값
3
|
| 17236 |
PHP
탈퇴합니다.
6
|
| 17220 | |
| 17217 |
JavaScript
회원가입
2
|
| 17216 | |
| 17214 | |
| 17207 | |
| 17205 | |
| 17203 | |
| 17201 | |
| 17198 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기