⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 base.js

📁 学生选课系统 赶快来下载啊啊好东西 呵呵啊啊 啊啊啊啊啊
💻 JS
📖 第 1 页 / 共 5 页
字号:
   obj.filters.alpha.opacity=val;
   clearInterval(highlighting);
  }else if(browser.isNS){
     obj.style.opacity=val/100;
     clearInterval(highlighting);
  }
}

//
function highLightIE(cur2){
   if(cur2.filters.alpha.opacity<100){
     cur2.filters.alpha.opacity+=5;
   }else if (window.highlighting){
     clearInterval(highlighting);
   }
}

//
function highLightFF(cur2){
   if(parseFloat(cur2.style.opacity)<1){
     var n=parseFloat(cur2.style.opacity);
     n+=0.015;
     cur2.style.opacity = n;
   }else if (window.highlighting){
     clearInterval(highlighting);
   }
}

//用户首页管理(删除板块)
function deleteItem(itemId){
  if($(itemId + "_OPTION").style.display == "none"){
    $(itemId + "_OPTION").style.display = "";
 	$(itemId + "_OPTION_A").className = "";
   Drag_delDrag(itemId);
  }
}

//用户首页管理(添加板块)
function addItem(itemId){
  if($(itemId + "_OPTION").style.display != "none"){
    if(Drag_addDrag(itemId)){
      $(itemId + "_OPTION").style.display = "none";
      $(itemId + "_OPTION_A").className = "selected";
	}
  }
}

function deleteHiddenItem(itemId){
  Drag_delDrag(itemId);
}

function savePageItem(button){
  $('_item_order_para').value = Drag_getDrags();
  if(button){
    button.disabled="true"
  }
  $('pageItemForm').submit();
}

function saveUserPageItem(obj){
  if(obj){
    obj.disabled="true";
  }
  $('_item_order_para').value = Drag_getDrags();
  //alert($('_item_order_para').value);
  $('userPageItemForm').submit();
}

// str 是否包括 subStr
// 如果包括,返回true;否则,返回false;

function containStr(str,subStr){
  if(str.indexOf(subStr) >= 0){
    return true;
  }

  return false;
}

// 主题搜索提交;
function searchTopics(formId,button,keywordId,nickNameId){
  //检查关键字中是否有"*""?"
  var keywordValue = $(keywordId).value;
  if(keywordValue == ""){
    alert("关键字必须填写");
    return false;
  }
  if(containStr(keywordValue,"*")){
    alert("关键字中不能含有'*'");
    return false;
  }
  if(containStr(keywordValue,"?")){
    alert("关键字中不能含有'?'");
    return false;
  }
  //检查昵称中是否有"*""?"
  var nickNameValue = $(nickNameId).value;
  if(containStr(nickNameValue,"*")){
    alert("昵称中不能含有'*'");
    return false;
  }
  if(containStr(nickNameValue,"?")){
    alert("昵称中不能含有'?'");
    return false;
  }

  formSubmit(formId,button);
}

//附件搜索提交;

function searchAttachment(formId,button,keywordId){

  var keywordValue = $(keywordId).value;
  //检查关键字中是否有"*""?"
  if(containStr(keywordValue,"*")){
    alert("关键字中不能含有'*'");
    return false;
  }
  if(containStr(keywordValue,"?")){
    alert("关键字中不能含有'?'");
    return false;
  }

  formSubmit(formId,button);

}

//用户搜索提交;

function searchUser(formId,button,keywordId){

  var keywordValue = $(keywordId).value;
  //检查查询内容中是否有"*""?"
  if(containStr(keywordValue,"*")){
    alert("查询内容中不能含有'*'");
    return false;
  }
  if(containStr(keywordValue,"?")){
    alert("查询内容中不能含有'?'");
    return false;
  }

  formSubmit(formId,button);

}

//论坛标签搜索提交;

function searchTagsButton(formId,button,keywordId){

  var keywordValue = $(keywordId).value;
  //检查关键字中是否有"*""?"
  if(containStr(keywordValue,"*")){
    alert("关键字中不能含有'*'");
    return false;
  }
  if(containStr(keywordValue,"?")){
    alert("关键字中不能含有'?'");
    return false;
  }

  formSubmit(formId,button);

}

//论坛标签搜索提交;

function searchTags(formId,keywordId){

  var keywordValue = $(keywordId).value;
  //检查关键字中是否有"*""?"
  if(containStr(keywordValue,"*")){
    alert("关键字中不能含有'*'");
    return false;
  }
  if(containStr(keywordValue,"?")){
    alert("关键字中不能含有'?'");
    return false;
  }

  formSubmit(formId);

}


var activeTips = new Array();
var curActTip = null;
function showTip(tipId){
	var st;
	if(activeTips[tipId] == null){
		st = new Object();
		st.id = tipId;
		st.initialized = false;
		activeTips[tipId] = st;
	}else{
		st = activeTips[tipId];
	}

	if(!st.initialized){
		initTip(st);
		if(!st.initialized) return;
	}

	if(curActTip == st){
		return;
	}

	if(curActTip != st){
		var mouseY = st.srcPos.top + st.srcHeight - 2;
		var mouseX = st.srcPos.left;// + st.srcWidth*0.8;
		//alert(st.srcWidth);
		if(browser.isIE){
			st.iframeEl.style.top = mouseY + "px";
			st.iframeEl.style.left = mouseX + "px";
			st.iframeEl.style.display = "block";
		}
		st.tip.style.top = mouseY + "px";
		st.tip.style.left = mouseX + "px";
		st.tip.style.width = st.tipWidth + "px";
		//alert(st.tip.offsetWidth);
		st.tip.style.display = "block";
		curActTip = st;
	}else{
		curActTip = null;
	}

}

function initTip(st){
	st.tip = $(st.id);
	if(st.tip == null) return;
	st.initialized = true;
	var tip = st.tip;
	tip.style.position = "absolute";
  tip.style.display = "block";
	st.tipWidth = getChildNodeWidth(tip);
	st.tipHeight = Element.getHeight(tip);

	var event = Event.getEvent();
	var src = getEventSrcElement(event);
	st.src = src;
	st.srcWidth = Element.getWidth(src);
	st.srcHeight = Element.getHeight(src);
	var pos = getOffset(src);
	st.srcPos = pos;

	if (browser.isIE) {
    var iframeEl = document.createElement("IFRAME");
    iframeEl.frameBorder = 0;
    iframeEl.src = "javascript:false;";
    iframeEl.style.display = "none";
    iframeEl.style.position = "absolute";
    iframeEl.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
    iframeEl.style.zIndex = 99;
    st.iframeEl = tip.parentNode.insertBefore(iframeEl, st.tip);
    
    iframeEl.style.height = st.tipHeight + "px";
    iframeEl.style.width = st.tipWidth + "px";
  }
}

function hideTip(){
	if(curActTip != null){
		if(browser.isIE){
			curActTip.iframeEl.style.display = "none";
		}
		curActTip.tip.style.display = "none";
		curActTip = null;
	}
}
/***/

/**
 * 弹出窗口
 * 用于提示错误、成功信息、警告等
 * 创建日期 2007-4-9
 * @author Harold.HH
 * @version 1.0
 */

<!--根据元素编号来获取元素,私有方法-->
function dialog(){

	window.ebDialog = null;
	this.elt = null;
	<!--弹出窗口的标题-->
	var title = '';
	<!--弹出窗口的宽度-->
	var width = 300;
	<!--弹出窗口的高度-->
	var height = 180;
	<!--弹出窗口的展示图片的地址动态使用-->
	var src = "";
	<!--使用皮肤的路经-->
	var path = _contextPath+"/ef/images/dialog/";
	<!--确定按钮-->
	var sFunc = '<input id="dialogOk" type="button" style="{width:62px;height:22px;border:0;background:url(\''+path+'smb_btn_bg.gif\');line-height:20px;" value="确认" onclick="new dialog().reset();" /> <input id="dialogCancel" type="button" style="{width:62px;height:22px;border:0;background:url(\''+path+'smb_btn_bg.gif\');line-height:20px;" value="取消" onclick="new dialog().reset();" />';
	<!--关闭按钮-->
	var sClose = '<input type="image" id="dialogBoxClose" onclick="new dialog().reset();" src="' + path + 'dialogClose0.gif" border="0" width="17" height="17" onmouseover="this.src=\'' + path + 'dialogCloseF.gif\';" onmouseout="this.src=\'' + path + 'dialogClose0.gif\';" align="absmiddle" />';
		<!--弹出窗口体内容和操作-->
	var sBody = '\
		<table id="dialogBodyBox" style border="0" align="center" cellpadding="0" cellspacing="0">\
			<tr height="10"><td colspan="4"></td></tr>\
			<tr>\
				<td width="10"></td>\
				<td width="80" align="center" valign="absmiddle"><img id="dialogBoxFace"  src="' + path + '3.gif" /></td>\
				<td id="dialogMsg" style="font-size:12px;"></td>\
				<td width="10"></td>\
			</tr>\
			<tr height="10"><td colspan="4" align="center"></td></tr>\
			<tr><td id="dialogFunc" colspan="4" align="center">' + sFunc + '</td></tr>\
			<tr height="10"><td colspan="4" align="center"></td></tr>\
		</table>\
	';
	
	
	<!--窗体标题栏广告和阴影-->
	var sBox = '\
		<table id="dialogBox" align="center" width="' + width + '" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #000;display:none;z-index:10;" alt="dialog">\
			<tr height="1" bgcolor="#FFFFFF"><td></td></tr>\
			<tr height="25" bgcolor="#000000">\
				<td>\
					<table onselectstart="return false;" style="-moz-user-select:none;" width="100%" border="0" cellpadding="0" cellspacing="0">\
						<tr>\
							<td width="6"></td>\
							<td id="dialogBoxTitle" onmousedown="new dialog().moveStart(event, \'dialogBox\')" style="color:#fff;cursor:move;font-size:12px;font-weight:bold;">&nbsp;</td>\
							<td id="dialogClose" width="27" align="right" valign="middle">\
								' + sClose + '\
							</td>\
							<td width="6"></td>\
						</tr>\
					</table>\
				</td>\
			</tr>\
			<tr height="2" bgcolor="#EDEDED"><td></td></tr>\
			<tr id="dialogHeight" style="height:' + height + 'px">\
				<td id="dialogBody" valign="top" bgcolor="#ffffff" >' + sBody + '</td>\
			</tr>\
		</table>\
		<div id="dialogBoxIframe" width="300px" style="position:absolute;display:none;" frameborder="2"></div>\
		<div id="dialogBoxShadow" style="display:none;z-index:9;"></div>\
	';
	<!--背影-->
	var sBG = '\
		<div id="dialogBoxBG" style="position:absolute;top:0px;left:0px;width:100%;height:200px;background:url('+path+'blank.gif);"></div>\
	';

	<!--具体的表现方式处理一些加广告,带阴影等-->
	this.show = function(){
	
		this.middle('dialogBox');
		this.shadow();
		//$('adframe').src = '/lm/iframe/20/20070406/16.html';
		$("dialogBoxBG").style.width = document.body.scrollWidth;
		$("dialogBoxBG").style.height = document.body.scrollHeight;
		
		
	}
	<!--重设置方法,元素重新赋值-->
	this.reset = function(){
		$('dialogBox').style.display='none';
		$('dialogBoxBG').style.display='none';
		$('dialogBoxShadow').style.display = "none";
		$('dialogBoxIframe').style.display = "none";
		$('dialogBody').innerHTML = sBody;
		changeShow();
		//document.body.removeChild($('_dgc'));
		//alert($('_dgc').outerHTML);//.outerHYML='';
//		var elt=$('pDiv');
//		if (elt)
//	    {
//		    elt.style.display = "none";
//		    elt.parentNode.removeChild(elt);
//  		    window.clearInterval(timer)  
//	    }
	     window.neatDialog = null;
		}
	<!--接收外部的Html作为信息展示-->
	this.html = function(_sHtml){$("dialogBody").innerHTML = _sHtml;this.show();}
	<!--初始化方法,创建一个span并加入-->
	this.init = function(){
		
		$('dialogCase') ? $('dialogCase').parentNode.removeChild($('dialogCase')) : function(){};
		  
		var oDiv = document.createElement('div');
		oDiv.id = "dialogCase";
		oDiv.style.zIndex="100";
		oDiv.innerHTML = sBG + sBox;	
		
		if(!document.getElementById('pDiv')){
		var bgDiv = document.createElement('div');
		bgDiv.id="pDiv";
		bgDiv.style.position = 'absolute';
		bgDiv.style.top="0px";
	  	bgDiv.style.left="0px";
	  
		bgDiv.style.width = getBodySize().width+"px";
		bgDiv.style.height = getBodySize().height+"px";//document.body.clientHeight;//getBodyHeight()<screen.height?screen.height:getBodyHeight()+"px";
		bgDiv.style.zIndex="7";
		bgDiv.style.display="none";
		

	
		document.body.appendChild(bgDiv);

		} else {
		var bgDiv = document.getElementById('pDiv') ;
			bgDiv.style.width = getBodySize().width+"px";
			bgDiv.style.height = getBodySize().height+"px";//document.body.clientHeight;//getBodyHeight()<screen.height?screen.height:getBodyHeight()+"px";
		}
		 
		document.body.appendChild(oDiv);
		
             

		hide();
		
	   
	}

function check(_sFuc){
    var sFuc = String(eval(_sFuc));
    if(sFuc != "undefined"){
      var url;
      if(sFuc.indexOf('#')){
         url =  sFuc.split('#')[0];
      }else{
         url = sFuc;
      }
      window.location = url;
    }
}

	<!--按钮初始化-可定制按钮的反应值-->
	this.button = function(_sId, _sFuc){
		if($(_sId)){
			$(_sId).style.display = '';
			if($(_sId).addEventListener){

				if($(_sId).act){$(_sId).removeEventListener('click', function(){eval($(_sId).act)}, false);}
				$(_sId).act = _sFuc;
        $(_sId).addEventListener('click', function(){check(_sFuc);}, false);

			}else{

				if($(_sId).act){$(_sId).detachEvent('onclick', function(){eval($(_sId).act)});}
				$(_sId).act = _sFuc;
        $(_sId).attachEvent('onclick', function(){check(_sFuc);});

			}
		}
	}




	<!--设置效果-->
	this.shadow = function(){
		var oShadow = $('dialogBoxShadow');
		var oDialog = $('dialogBox');
		var oIframe = $('dialogBoxIframe');
		oShadow.style.position = "absolute";
		oIframe.style.position = "absolute";

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -