📄 projectout.js
字号:
/*
Author:Stone,Andyfoo
Homepage:Andyfoo.Net
Company:Kehu.cn
*/
var calendar_open = false;
function calendar(calendar_path){
if(!calendar_open){
if(!calendar_path)var calendar_path = "calendar/";
document.write("<iframe width=174 height=189 name='gToday:normal:calendar_agenda.js' id='gToday:normal:calendar_agenda.js' ");
document.write(" src='" + calendar_path + "calendar.htm' scrolling='no' frameborder='0' ");
document.write(" style='visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;'>");
document.write("</iframe>");
}
calendar_open=true;
//document.getElementById('gToday:normal:calendar_agenda.js').src = calendar_path + "calendar.htm";
}
function set_html(id, html)
{
document.getElementById(id).innerHTML=html;
}
function set_text(id, text)
{
document.getElementById(id).innerTEXT=text;
}
function hide_obj(id){
document.getElementById(id).style.display='none'
}
function show_obj(id){
document.getElementById(id).style.display=''
}
function showhide_obj(id){
if(document.getElementById(id).style.display==''){
document.getElementById(id).style.display='none';
return 'close';
}else{
document.getElementById(id).style.display='';
return 'open';
}
}
function set_src(id, value){
document.getElementById(id).src=value
}
function select_all(form, s, sel)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name.substring(0, sel.length) == sel)
e.checked = s.checked;
}
}
function select_submit(form, action)
{
form.action = action;
form.submit();
}
function btn_confirm(url, msg)
{
if(confirm(msg))
window.location=url;
return false;
}
function set_default( form, label,value){
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
switch(e.type){
case 'radio':
case 'checkbox':if(e.name == label && e.value == value)e.checked = true;break;
case 'multiple':
case 'select':
case 'select-one':
if(e.name == label){
for (var d=0; d<e.options.length; d++){
if(e.options[d].value == value ){
e.selectedIndex = d;
}
}
}
break;
default:
break;
}
}
}
//<<+================
/***************
var pane1 = "aa";
var pane2 = "bb";
var pane3 = "Enter message here:<br><textarea cols=50 rows=6></textarea>";
var pane4 = "<table border=1><tr><td width=100><input name='cSport' type='checkbox' class='chk'>Sport</input><br><input type='checkbox' class='chk' name='cGifts'>Gifts</input><br><input type='checkbox' class='chk' name='cHealth'>Health</input><br></td><td width=100><input name='cInet' type='checkbox' class='chk'>Internet</input><br><input type='checkbox' class='chk' name='cGames'>Games</input><br><input type='checkbox' class='chk' name='cTech'>Technology</input></td><td width=100><input name='cBooks' type='checkbox' class='chk'>Books</input><br><input type='checkbox' name='cFash'>Fashion</input><br><input type='checkbox' class='chk' name='cCars'>Cars</input><br></td></tr></table>";
var pane5 = "<hr><p>This is a test of a javascript simulating a tab control<hr>";
var ts = new tabstrip();
var t1 = new tab("网站信息",pane1);
var t2 = new tab("结算帐户",pane2);
var t3 = new tab("结算周期",pane3);
var t4 = new tab("支付密码",pane4);
var t5 = new tab("返回网址",pane5);
ts.add(t1);
ts.add(t2);
ts.add(t3);
ts.add(t4);
ts.add(t5);
ts.write();
***************/
var currentPaneStyle = 0;
var currentTab = 0;
var tabNumber = 0;
// alert( readCookie("myCookie") );
function readCookie(name)
{
var cookieValue = "";
var search = name + "=";
if(document.cookie.length > 0)
{
offset = document.cookie.indexOf(search);
if (offset != -1)
{
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end))
}
}
return cookieValue;
}
// Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function writeCookie(name, value, hours)
{
var expire = "";
if(hours != null)
{
expire = new Date((new Date()).getTime() + hours * 3600000);
expire = "; expires=" + expire.toGMTString();
}
document.cookie = name + "=" + escape(value) + expire;
}
function tabstrip()
{
this.tabs = new Array();
this.add = addTab;
this.write = writeTabstrip;
}
function tab(caption,content)
{
this.setId = setId;
this.caption = caption;
this.content = content;
this.write = writeTab;
this.writeContent = writePane;
}
function addTab(tab)
{
tab.setId("tab" + this.tabs.length);
this.tabs[this.tabs.length] = tab;
tabNumber++;
}
function setId(id)
{
this.id = id;
}
function initiate()
{
var CookieTabId = readCookie("__CookieTabId__");
if(CookieTabId != null && document.getElementById(CookieTabId) != null)
var div = document.getElementById(CookieTabId);
else
var div = document.getElementById("tab0");
showPane(div);
}
function showPane(div)
{
for(i = 0; i < tabNumber; i++)
{
document.getElementById("tab" + i).className = "tabs_out";
document.getElementById("pn_tab" + i).style.display = "none";
}
div.className = "tabs_over";
document.getElementById("pn_" + div.id).style.display = "block";
writeCookie("__CookieTabId__", div.id, 24);
}
function SubmitForm()
{
window.alert("Form submitted. This would normally take you to another page");
// normally, you would here check the form and submit it.
// if the form has the name 'tabform', then it is submitted
// with tabform.submit();
}
function writePane()
{
document.write("<div class='tabs_pane' id='pn_" + this.id + "'>" + this.content + "</div>");
}
function writeTab()
{
document.write("<td class='tabs_out' id='" + this.id + "' onclick='showPane(this)'>" + this.caption + "</td>");
}
function writeTabstrip()
{
document.write("<table border='0' cellpadding='3' cellspacing='0' class='tabs_table'><tr>");
for(var i = 0; i < this.tabs.length; i++)
{
this.tabs[i].write();
}
document.write("</tr></table>");
document.write("<table class='tabs_line' border='0' cellpadding='4' cellspacing='0'><tr><td height='4'></td></tr></table>");
for(var k = 0; k < this.tabs.length; k++)
{
this.tabs[k].writeContent();
}
initiate();
}
<!--
/*=============================
<table width='100%' border='0' cellspacing='1' cellpadding='3' class='tpl_border_color' style='FONT-SIZE: 12px; word-break: break-all; ' id='data_table'>
<tr height='23' class='tpl_bgcolor_02'>
<th width="50%">tt1</th>
<th width="50%">tt2</th>
</tr>
<tr height='20' class='tpl_list_01' >
<td align="center">d1</td>
<td align="center">d2</td>
</tr>
<tr height='20' class='tpl_list_01' >
<td align="center">d1</td>
<td align="center">d2</td>
</tr>
<tr height='20' class='tpl_list_01' >
<td align="center">d1</td>
<td align="center">d2</td>
</tr>
</table>
<script language="JavaScript">
<!--
tigra_tables('data_table', 1, 0, 'tpl_list_01', 'tpl_list_02', 'tpl_list_over', 'tpl_list_click');
// -->
</script>
==========================*/
var ie5 = (document.getElementById && document.all);
var ns6 = (document.getElementById && !document.all);
document.write("<style type=\"text/css\">");
document.write(".js_list_01 {BACKGROUND-COLOR: #ffffff}");
document.write(".js_list_02 { BACKGROUND-COLOR: #FFF0F5}");
document.write(".js_list_over { BACKGROUND-COLOR: #FFF68F}");
document.write(".js_list_click { BACKGROUND-COLOR: #EED5D2}");
document.write("</style>");
var init_click_disable = true;
function tigra_tables (
str_tableid, // table id (req.)
num_header_offset, // how many rows to skip before applying effects at the begining (opt.)
num_footer_offset, // how many rows to skip at the bottom of the table (opt.)
str_odd_class, // background class for odd rows (opt.)
str_even_class, // background class for even rows (opt.)
str_mover_class, // background class for rows with mouse over (opt.)
str_onclick_class, // background class for marked rows (opt.)
click_disable //click disable
) {
// skip non DOM browsers
if (ie5 || ns6){
// validate required parameters
if (!str_tableid) return alert ("No table(s) ID specified in parameters");
var obj_tables = (document.all ? document.all[str_tableid] : document.getElementById(str_tableid));
if (!obj_tables) return alert ("Can't find table(s) with specified ID (" + str_tableid + ")");
// set defaults for optional parameters
var col_config = [];
col_config.header_offset = (num_header_offset ? num_header_offset : 0);
col_config.footer_offset = (num_footer_offset ? num_footer_offset : 0);
col_config.odd_class = (str_odd_class ? str_odd_class : 'js_list_01');
col_config.even_class = (str_even_class ? str_even_class : 'js_list_02');
col_config.mover_class = (str_mover_class ? str_mover_class : 'js_list_over');
col_config.onclick_class = (str_onclick_class ? str_onclick_class : 'js_list_click');
// init multiple tables with same ID
init_click_disable = click_disable;
if (obj_tables.length){
for (var i = 0; i < obj_tables.length; i++){
tt_init_table(obj_tables[i], col_config);
// init single table
}
}else{
tt_init_table(obj_tables, col_config);
}
}
}
function tt_init_table (obj_table, col_config) {
var col_lconfig = [],
col_trs = obj_table.rows;
for (var i = col_config.header_offset; i < col_trs.length - col_config.footer_offset; i++) {
col_trs[i].config = col_config;
col_trs[i].lconfig = col_lconfig;
col_trs[i].set_class = tt_set_class;
col_trs[i].onmouseover = tt_mover;
col_trs[i].onmouseout = tt_mout;
col_trs[i].onmousedown = tt_onclick;
col_trs[i].order = (i - col_config.header_offset) % 2;
col_trs[i].onmouseout();
}
}
function tt_set_class(str_class) {
this.className = str_class;
}
// event handlers
function tt_mover () {
if (this.lconfig.clicked != this)
this.set_class(this.config.mover_class);
}
function tt_mout () {
if (this.lconfig.clicked != this){
this.set_class(this.order ? this.config.odd_class : this.config.even_class);
}
}
function tt_onclick () {
if(init_click_disable) return;
if (this.lconfig.clicked == this) {
this.lconfig.clicked = null;
this.onmouseover();
}
else {
var last_clicked = this.lconfig.clicked;
this.lconfig.clicked = this;
if (last_clicked) {
last_clicked.onmouseout();
}
this.set_class(this.config.onclick_class);
}
}
//-->
//===================>>>
var cfg_fade_switch=true;
var cfg_xoffset=9;
var cfg_yoffset=20;
var cfg_mouse_follow=true;
var cfg_hide_delay=8000;
var cfg_txt_tag='alt';
var cfg_is_show=true;
document.write("<style>.navtext_div{PADDING-RIGHT: 6px; PADDING-LEFT: 6px;PADDING-TOP: 2px; PADDING-BOTTOM: 1px; FONT-SIZE: 12px; Z-INDEX: 99; VISIBILITY: hidden; COLOR: #333333; BORDER: 1px #8899AA solid;FONT-FAMILY: Courier New,tahoma,arial; POSITION: absolute; BACKGROUND-COLOR: #FFFFCC;}</style>");
document.write('<div id="navtext_div" class="navtext_div" style="visibility:hidden; position:absolute; top:0px; left:-400px; z-index:10000; padding:3px"></div>');
function xalt_props(){
this.w3c=(document.getElementById)?true:false;
this.ns4=(document.layers)?true:false;
this.ie4=(document.all && !this.w3c)?true:false;
this.ie5=(document.all && this.w3c)?true:false;
this.ns6=(this.w3c && navigator.appName.indexOf("Netscape")>=0 )?true:false;
this.w_y=0;
this.w_x=0;
this.navtxt=null;
this.boxheight=0;
this.boxwidth=0;
this.ishover=true;
this.ieop=0;
this.op_id=0;
this.oktomove=true;
this.dy=0;
}
function xalt_kill_errors() {
return true;
}
var XALT=new xalt_props();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -