»
Tiếng AnhTiếng PhápTiếng Việt

In - Tạo các tab nội dung - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Ứng dụng » Công cụ xuất » Tạo các tab nội dung
URL: https://www.javascriptbank.com/sections-maker-script.html

Tạo các tab nội dung © JavaScriptBank.comMột công cụ tạo các tab nội dung cho trang web, khi tạo xong bạn có thể xuất sang mã HTML để dán vào các trang web khác.

Phiên bản đầy đủ: jsB@nk » Ứng dụng » Công cụ xuất » Tạo các tab nội dung
URL: https://www.javascriptbank.com/sections-maker-script.html



CSS
<style type="text/css">body{background:white}body, td, h2{font-family:verdana,arial,sans-serif}h2{color:#ff9900}a.ch, a.ch:visted{color:#ff0000;text-decoration:none}a:hover{text-decoration:underline}table{width:100%;padding:4px}.i{background:#ffdab9;height:4in;border-right: 3px outset #ffffff;border-left: 3px outset #ffffff;border-bottom: 3px outset #ffffff}.on{background:#ffdab9;text-align:center;color:#ff0000;border-right: 3px outset #ffffff;border-left: 3px outset #ffffff;border-top: 3px outset #ffffff}.off{background:#dcdcdc;text-align:center;border-right: 3px outset #ffffff;border-left: 3px outset #ffffff;border-bottom: 3px inset #ffffff}.o{position:relative;width:98%;visibility:hidden;}.nota{background:#ffffff}</style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script language="javascript" type="text/javascript"><!--var R=new Array();var N="",nR=0,db=-1;sty="\<style type=\"text/css\">\nbody{background:white}\nbody,td,h2{font-family:verdana,arial,sans-serif}\nh2{color:#ff9900}\na.ch,a.ch:visted{color:#ff0000;text-decoration:none}\na:hover{text-decoration:underline}\ntable{width:100%;padding:4px}\n.i{background:#ffdab9;height:4in;border-right: 3px outset #ffffff;border-left: 3px outset #ffffff;border-bottom: 3px outset #ffffff}\n.on{background:#ffdab9;text-align:center;color:#ff0000;border-right: 3px outset #ffffff;border-left: 3px outset #ffffff;border-top: 3px outset #ffffff}\n.off{background:#dcdcdc;text-align:center;border-right: 3px outset #ffffff;border-left: 3px outset #ffffff;border-bottom: 3px inset #ffffff}\n.o{position:absolute;width:98%;visibility:hidden}\n.nota{background:#ffffff}\n\<\/style>";document.write(sty);function vl(z){z = unescape(escape(z).replace(/%0D%0A/g,"%7C").replace(/%0A/g,"%7C").replace(/%0D/g,"%7C"));R=z.split("|");db=-1;nR=0;for(i=0;i<R.length;i++){if(R[i]!=""){if(db==-1){db=i}nR++}}nRstring = '' + nRalert(nRstring+" item(s) typed in.");}function pr(ici){if(nR>0){msg="<!!!JSBank Website presents\">\n\<html>\<head>\n"+sty+"\n\<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n\<title>Title of my page\<\/title>\n\<script language=\"javascript\" type=\"text/javascript\">\nvar N=\"\"\n"+fco+fvo+"\<\/script>\n\<\/head>\<body onload=\"vO('"+(R.length-1)+"');vO('"+db+"')\">\n\<!-- tool : michel.staelens@wanadoo.fr - www.freejavascript.fr.st -->\n\<!-- Begin of common section -->\n\nInclude the common section here\n\n\<!-- End of common section -->\n<br>\n";for(j=0;j<R.length;j++){if(R[j]!=""){msg+='<div id=\'d'+j+'\'class=o><table cellspacing=0><tr>';for(i=0;i<R.length;i++){if(i==j){msg+='\<td class=on>'+R[i]+'\<\/td>'}else{if(R[i]!=""){msg+='\<td class=off>\<a class=ch href="javascript:vO(\''+i+'\')">'+R[i]+'\<\/a>\<\/td>'}}}msg+='\<\/tr>\<tr>\<td colspan='+(nR+1)+' class=i>\n<!-- Begin of '+R[j]+' -->\nInclude section \<span class=nota>'+R[j]+'\<\/\span> here.\n\<!-- End of '+R[j]+' -->\n\<\/td>\<\/tr>\<\/table>\<\/div>\n'}}msg+="\<\/body>\<\/html>";ici.value=msg;ici.focus();ici.select()}else{alert("Items in previous section not validated!")}}//--></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<body onload="vO('2');vO('0')">    <h2>Sections maker</h2>    <div id="d0" class="o" style="visibility: hidden;">       <table cellspacing="0">        <tbody><tr>           <td class="on">Purpose</td>          <td class="off">             <a class="ch" href="javascript:vO('1')">Parameters</a>          </td>          <td class="off">             <a class="ch" href="javascript:vO('2')">HTML source</a>          </td>        </tr>        <tr>           <td colspan="4" class="i">             <h2>This page will clone itself!</h2>            <span class="nota">The purpose of this page is to automatically build the HTML code for a page that you can use to display sections of your text as folders on one web page.</span><br>            <i>Note: this application is valid HTML 4.01 and produces valid pages.</i>           </td>        </tr>      </tbody></table>    </div>    <div id="d1" class="o">       <table cellspacing="0">        <tbody><tr>           <td class="off">             <a class="ch" href="javascript:vO('0')">Purpose</a>          </td>          <td class="on">Parameters</td>          <td class="off">             <a class="ch" href="javascript:vO('2')">HTML source</a>          </td>        </tr>        <tr>           <td colspan="4" class="i"> Type the name of each section (one item per line) and click the validate button.             <form action="post">              <textarea cols="40" rows="9"></textarea>              <input type="button" value="validate" onclick="vl(this.form.elements[0].value)">             </form>          </td>        </tr>      </tbody></table>    </div>    <div id="d2" class="o" style="visibility: visible;">       <table cellspacing="0">        <tbody><tr>           <td class="off">             <a class="ch" href="javascript:vO('0')">Purpose</a>          </td>          <td class="off">             <a class="ch" href="javascript:vO('1')">Parameters</a>          </td>          <td class="on">HTML source</td>        </tr>        <tr>           <td colspan="4" class="i"> Copy and paste the following html code into a text file named [for example] &quot;myPage.<b>html</b>&quot;; then customize if necessary, modifying the color, font, etc...inside the style tags. Include the different sections of your text inside the indicated areas. <form action="post">              <input type="button" value="produce the HTML code" onclick="pr(this.form.elements[1])"><br>              <textarea cols="60" rows="12"></textarea>            </form>          </td>        </tr>      </tbody></table>    </div><script language="javascript" type="text/javascript">fco='function cO(z){document.getElementById(\'d\'+z).style.visibility="hidden"}\n';fvo='function vO(z){if (N!=z&&N!=""){cO(N)} document.getElementById(\'d\'+z).style.visibility="visible";N=z}\n';eval(fco);eval(fvo)    </script> </body><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->