탭 메뉴 구성 > script

본문 바로가기
사이트 내 전체검색

script

탭 메뉴 구성

페이지 정보

작성자 서방님 댓글 0건 조회 176회 작성일 07-08-11 15:43

본문

<html>
<head>
    <title>http://www.blueb.co.kr</title>
<style>
.tabPanelGroup {
  margin:10px; padding:0;
  border:1px solid #EBEBEB;
}
.tabPanel {
  margin:0;
  padding:10px;
  color:#000000;
  background: rgb( 252, 252, 254 );
  border-left:            1px solid rgb( 145, 155, 156 );
  border-bottom:        1px solid rgb( 145, 155, 156 );
  border-right:            1px solid rgb( 145, 155, 156 );

}
.tabGroup {
  margin:0; padding:0;
}
.tabDefault {
  margin:0;
  padding:2px;
  font-family: Tahoma, Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: normal;
  color:#012E58;
  background: #ff9198;
}
.tabSelected {
  margin:0;
  padding:2px;
  font-family: Tahoma, Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: bold;
  color:#012E58;
  background: rgb( 252, 252, 254 );
}
</style>
<style type='text/css'>
</style>
<script type='text/javascript' src='http://www.blueb.co.kr/SRC/javascript/js/x_core.js'></script>
<script type='text/javascript' src='http://www.blueb.co.kr/SRC/javascript/js/x_dom.js'></script>
<script type='text/javascript'>
function xTabPanelGroup(id, w, h, th, clsTP, clsTG, clsTD, clsTS) // object prototype
{
  // Private Methods

  function onClick() //r7
  {
    paint(this);
    return false;
  }
  function onFocus() //r7
  {
    paint(this);
  }
  function paint(tab)
  {
    tab.className = clsTS;
    xZIndex(tab, highZ++);
    xDisplay(panels[tab.xTabIndex], 'block'); //r6
    if (selectedIndex != tab.xTabIndex) {
      xDisplay(panels[selectedIndex], 'none'); //r6
      tabs[selectedIndex].className = clsTD;
      selectedIndex = tab.xTabIndex;
    }
  }

  // Private Properties

  var panelGrp, tabGrp, panels, tabs, highZ, selectedIndex;
 
  // Public Methods

  this.select = function(n) //r7
  {
    if (n && n <= tabs.length) {
      var t = tabs[n-1];
      if (t.focus) t.focus();
      else t.onclick();
    }
  };
  this.onUnload = function()
  {
    if (!window.opera) for (var i = 0; i < tabs.length; ++i) {tabs[i].onfocus = tabs[i].onclick = null;}
  };
  this.onResize = function(newW, newH) //r9
  {
    var x = 0, i;
    // [r9
    if (newW) {
      w = newW;
      xWidth(panelGrp, w);
    }
    else w = xWidth(panelGrp);
    if (newH) {
      h = newH;
      xHeight(panelGrp, h);
    }
    else h = xHeight(panelGrp);
    // r9]
    xResizeTo(tabGrp[0], w, th);
    xMoveTo(tabGrp[0], 0, 0);
    w -= 2; // remove border widths
    var tw = w / tabs.length;
    for (i = 0; i < tabs.length; ++i) {
      xResizeTo(tabs[i], tw, th);
      xMoveTo(tabs[i], x, 0);
      x += tw;
      tabs[i].xTabIndex = i;
      tabs[i].onclick = onClick;
      tabs[i].onfocus = onFocus; //r7
      xDisplay(panels[i], 'none'); //r6
      xResizeTo(panels[i], w, h - th - 2); // -2 removes border widths
      xMoveTo(panels[i], 0, th);
    }
    highZ = i;
    tabs[selectedIndex].onclick(); //r9
  };

  // Constructor Code

  panelGrp = xGetElementById(id);
  if (!panelGrp) { return null; }
  panels = xGetElementsByClassName(clsTP, panelGrp);
  tabs = xGetElementsByClassName(clsTD, panelGrp);
  tabGrp = xGetElementsByClassName(clsTG, panelGrp);
  if (!panels || !tabs || !tabGrp || panels.length != tabs.length || tabGrp.length != 1) { return null; }
  selectedIndex = 0;
  this.onResize(w, h); //r9
}

</script>
<script type='text/javascript'>
document.write("<link rel='stylesheet' type='text/css' href='http://www.blueb.co.kr/SRC/javascript/js/tpg_dyn.css'>");
var tpg1, tpg2;
window.onload = function()
{
  tpg1 = new xTabPanelGroup('tpg1', 300, 150, 22, 'tabPanel', 'tabGroup', 'tabDefault', 'tabSelected');
  tpg2 = new xTabPanelGroup('tpg2', 500, 250, 40, 'tabPanel', 'tabGroup', 'tabDefault', 'tabSelected');
  tpg2.select(3);
}
window.onunload = function()
{
  if (tpg1) tpg1.onUnload();
  if (tpg2) tpg2.onUnload();
}
</script>
</head>
<body>

<h3>Demo 1</h3>
<div>
<div id='tpg1' class='tabPanelGroup'>

  <div class='tabGroup'>
    <a href='#tpg11' class='tabDefault'>General</a><span class='linkDelim'>&nbsp;|&nbsp;</span>
    <a href='#tpg12' class='tabDefault'>Javascript</a><span class='linkDelim'>&nbsp;|&nbsp;</span>
    <a href='#tpg13' class='tabDefault'>CSS</a><span class='linkDelim'>&nbsp;|&nbsp;</span>
    <a href='#tpg14' class='tabDefault'>HTML</a>
  </div>
 
  <div id='tpg11' class='tabPanel'>
    <h4>General</h4>
    <p>Tab panel groups. Multiple objects can be instantiated on one page.</p>
  </div>
 
  <div id='tpg12' class='tabPanel'>
    <h4>Javascript</h4>
    <p>Cross-browser, downgradeable, and unobtrusive. Disable Javascript and reload this page.</p>
  </div>
 
  <div id='tpg13' class='tabPanel'>
    <h4>CSS</h4>
    <p>In 2 files: tpg_def.css for default styles, and tpg_dyn.css for dynamic overrides when Javascript is enabled.</p>
  </div>
 
  <div id='tpg14' class='tabPanel'>
    <h4>HTML</h4>
    <p>The content is in the HTML - it is not written with Javascript.</p>
  </div>
 
</div>
</div>

<h3>Demo 2</h3>
<div>
<div id='tpg2' class='tabPanelGroup'>

  <div class='tabGroup'>
    <a href='#tpg21' class='tabDefault'>But I must explain</a><span class='linkDelim'>&nbsp;|&nbsp;</span>
    <a href='#tpg22' class='tabDefault'>Sed ut perspiciatis</a><span class='linkDelim'>&nbsp;|&nbsp;</span>
    <a href='#tpg23' class='tabDefault'>On the other hand</a><span class='linkDelim'>&nbsp;|&nbsp;</span>
    <a href='#tpg24' class='tabDefault'>At vero eos et</a>
  </div>
 
  <div id='tpg21' class='tabPanel'>
    <h4>But I must explain...</h4>
    <form name='f1'>
      <input type='text' size='40'>
      <input type='button' value='ok'>
      <select id='sel1'>
        <option selected='1'>Select one of the following...</option>
        <option>Browse...</option>
        <option>Mars</option>
        <option>Veil Nebula</option>
      </select>
    </form>
    <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui do<a href="http://lipsum.com/" title="Read about Lorem Ipsum at lipsum.com">lorem ipsum</a> quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
  </div>
 
  <div id='tpg22' class='tabPanel'>
    <h4>Sed ut perspiciatis...</h4>
    <form name='f2'>
      <input type='text' size='30'>
      <input type='button' value='ok'>
      <br><textarea rows='5' cols='20'></textarea>
    </form>
    <p>But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?</p>
  </div>
 
  <div id='tpg23' class='tabPanel'>
    <h4>On the other hand...</h4>
    <form name='f2'>
      <input type='text' size='20'>
      <input type='button' value='ok'>
      <input type='checkbox'>
      <input type='checkbox'>
      <input type='checkbox'>
    </form>
    <p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</p>
  </div>
 
  <div id='tpg24' class='tabPanel'>
    <h4>At vero eos et...</h4>
    <form name='f4'>
      <input type='text' size='10'>
      <input type='button' value='ok'>
      <input name='r4' type='radio'>
      <input name='r4' type='radio'>
      <input name='r4' type='radio'>
    </form>
    <p>On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.</p>
  </div>
 
</div>
</div>

</body>
</html>

댓글목록

등록된 댓글이 없습니다.

Total 846건 31 페이지
게시물 검색

회원로그인

접속자집계

오늘
63
어제
302
최대
1,347
전체
155,124
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.