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

📄 showlist.js

📁 用JSP JAVA 做的 系统 只是初来扎到还望西黄!别乱来哦!
💻 JS
📖 第 1 页 / 共 5 页
字号:
var drag_minY;
var drag_maxY;
var dragInProgress;				// Variable which is true when drag is in progress, false otherwise
try{
if(!standardObjectsCreated)DHTMLSuite.createStandardObjects();	// This line starts all the init methods
}catch(e){
alert('You need to include the dhtmlSuite-common.js file');
}
this.dragX_allowed = true;
this.dragY_allowed = true;
this.currentZIndex = 21000;
this.dragDropTimer = -1;
this.dragObjCloneArray = new Array();
this.numericIdToBeDragged = false;
this.okToStartDrag = true;
this.moveBackBySliding = true;
this.dragInProgress = false;
var objectIndex;
this.objectIndex = DHTMLSuite.variableStorage.arrayOfDhtmlSuiteObjects.length;
DHTMLSuite.variableStorage.arrayOfDhtmlSuiteObjects[this.objectIndex] = this;
}
DHTMLSuite.dragDrop.prototype = {
init:function()
{
this.__initDragDropScript();
}
,
addSource:function(sourceId,slideBackAfterDrop,xAxis,yAxis,dragOnlyWithinElId)
{
if(!this.dragDropSourcesArray)this.dragDropSourcesArray = new Array();
if(!document.getElementById(sourceId)){
alert('The source element with id ' + sourceId + ' does not exists. Check your HTML code');
return;
}
if(xAxis!==false)xAxis = true;
if(yAxis!==false)yAxis = true;
var obj = document.getElementById(sourceId);
this.dragDropSourcesArray[this.dragDropSourcesArray.length]  = [obj,slideBackAfterDrop,xAxis,yAxis,dragOnlyWithinElId];
obj.setAttribute('dragableElement',this.dragDropSourcesArray.length-1);
obj.dragableElement = this.dragDropSourcesArray.length-1;
}
,
addTarget:function(targetId,functionToCallOnDrop)
{
if(!this.dragDropTargetArray)this.dragDropTargetArray = new Array();
if(!document.getElementById(targetId))alert('The target element with id ' + targetId + ' does not exists.  Check your HTML code');
var obj = document.getElementById(targetId);
this.dragDropTargetArray[this.dragDropTargetArray.length]  = [obj,functionToCallOnDrop];
}
,
setSlide:function(isSlidingAnimationEnabled)
{
this.moveBackBySliding = isSlidingAnimationEnabled;
}
,
__initDragDropScript:function()
{
var ind = this.objectIndex;
var refToThis = this;
var startIndex = Math.random() + '';
startIndex = startIndex.replace('.','')/1;
for(var no=0;no<this.dragDropSourcesArray.length;no++){
var el = this.dragDropSourcesArray[no][0].cloneNode(true);
var el2 = this.dragDropSourcesArray[no][0];
eval("el.onmousedown =function(e,index){ DHTMLSuite.variableStorage.arrayOfDhtmlSuiteObjects[" + ind + "].__initializeDragProcess(e," + no + "); }");
DHTMLSuite.commonObj.__addEventElement(el);
var tmpIndex = startIndex + no;
el.id = el2.id;	/* Override the value above */
el.style.position='absolute';
el.style.visibility='hidden';
el.style.display='none';
document.body.appendChild(el);
el.style.top = DHTMLSuite.commonObj.getTopPos(this.dragDropSourcesArray[no][0]) + 'px';
el.style.left = DHTMLSuite.commonObj.getLeftPos(this.dragDropSourcesArray[no][0]) + 'px';
eval("el2.onmousedown =function(e,index){ return DHTMLSuite.variableStorage.arrayOfDhtmlSuiteObjects[" + ind + "].__initializeDragProcess(e," + no + "); }");
DHTMLSuite.commonObj.__addEventElement(this.dragDropSourcesArray[no][0]);
this.dragObjCloneArray[no] = el;
}
eval("DHTMLSuite.commonObj.addEvent(document.documentElement,\"mousemove\",function(e){ DHTMLSuite.variableStorage.arrayOfDhtmlSuiteObjects[" + ind + "].__moveDragableElement(e); } )");
eval("DHTMLSuite.commonObj.addEvent(document.documentElement,\"mouseup\",function(e){ DHTMLSuite.variableStorage.arrayOfDhtmlSuiteObjects[" + ind + "].__stopDragProcess(e); } );");
if(!document.documentElement.onselectstart)document.documentElement.onselectstart = function() { return DHTMLSuite.commonObj.__getOkToMakeTextSelections(); };
document.documentElement.ondragstart = function() { return DHTMLSuite.commonObj.cancelEvent() };
DHTMLSuite.commonObj.__addEventElement(document.documentElement);
}
,
__initializeDragProcess:function(e,index)
{
var ind = this.objectIndex;
if(!this.okToStartDrag)return false;
setTimeout('DHTMLSuite.variableStorage.arrayOfDhtmlSuiteObjects[' + ind + '].okToStartDrag = true;',100);
if(document.all)e = event;
this.numericIdToBeDragged = index;
this.numericIdToBeDragged = this.numericIdToBeDragged + '';
this.dragDropTimer=0;
DHTMLSuite.commonObj.__setOkToMakeTextSelections(false);
this.mouse_x = e.clientX;
this.mouse_y = e.clientY;
this.currentZIndex = this.currentZIndex + 1;
this.dragObjCloneArray[this.numericIdToBeDragged].style.zIndex = this.currentZIndex;
this.currentEl_allowX = this.dragDropSourcesArray[this.numericIdToBeDragged][2];
this.currentEl_allowY = this.dragDropSourcesArray[this.numericIdToBeDragged][3];
var parentEl = this.dragDropSourcesArray[this.numericIdToBeDragged][4];
this.drag_minX = false;
this.drag_minY = false;
this.drag_maxX = false;
this.drag_maxY = false;
if(parentEl){
var obj = document.getElementById(parentEl);
if(obj){
this.drag_minX = DHTMLSuite.commonObj.getLeftPos(obj);
this.drag_minY = DHTMLSuite.commonObj.getTopPos(obj);
this.drag_maxX = this.drag_minX + obj.clientWidth;
this.drag_maxY = this.drag_minY + obj.clientHeight;
}
}
if(this.dragDropSourcesArray[this.numericIdToBeDragged][1]){
this.dragObjCloneArray[this.numericIdToBeDragged].style.top = DHTMLSuite.commonObj.getTopPos(this.dragDropSourcesArray[this.numericIdToBeDragged][0]) + 'px';
this.dragObjCloneArray[this.numericIdToBeDragged].style.left = DHTMLSuite.commonObj.getLeftPos(this.dragDropSourcesArray[this.numericIdToBeDragged][0]) + 'px';
}
this.el_x = this.dragObjCloneArray[this.numericIdToBeDragged].style.left.replace('px','')/1;
this.el_y = this.dragObjCloneArray[this.numericIdToBeDragged].style.top.replace('px','')/1;
this.__waitBeforeDragProcessStarts();
return false;
}
,
__waitBeforeDragProcessStarts:function()
{
var ind = this.objectIndex;
if(this.dragDropTimer>=0 && this.dragDropTimer<5){
this.dragDropTimer = this.dragDropTimer + 1;
setTimeout('DHTMLSuite.variableStorage.arrayOfDhtmlSuiteObjects[' + ind + '].__waitBeforeDragProcessStarts()',2);
return;
}
if(this.dragDropTimer>=5){
if(this.dragObjCloneArray[this.numericIdToBeDragged].style.display=='none'){
this.dragDropSourcesArray[this.numericIdToBeDragged][0].style.visibility = 'hidden';
this.dragObjCloneArray[this.numericIdToBeDragged].style.display = 'block';
this.dragObjCloneArray[this.numericIdToBeDragged].style.visibility = 'visible';
this.dragObjCloneArray[this.numericIdToBeDragged].style.top = DHTMLSuite.commonObj.getTopPos(this.dragDropSourcesArray[this.numericIdToBeDragged][0]) + 'px';
this.dragObjCloneArray[this.numericIdToBeDragged].style.left = DHTMLSuite.commonObj.getLeftPos(this.dragDropSourcesArray[this.numericIdToBeDragged][0]) + 'px';
}
}
}
,
__moveDragableElement:function(e)
{
var ind = this.objectIndex;
if(document.all)e = event;
if(this.dragDropTimer<5)return false;
if(this.dragInProgress)return false;
this.dragInProgress = true;
var dragObj = this.dragObjCloneArray[this.numericIdToBeDragged];
if(this.currentEl_allowX){
var leftPos = (e.clientX - this.mouse_x + this.el_x);
if(this.drag_maxX){
var tmpMaxX = this.drag_maxX - dragObj.offsetWidth;
if(leftPos > tmpMaxX)leftPos = tmpMaxX
if(leftPos < this.drag_minX)leftPos = this.drag_minX;
}
dragObj.style.left = leftPos + 'px';
}
if(this.currentEl_allowY){
var topPos = (e.clientY - this.mouse_y + this.el_y);
if(this.drag_maxY){
var tmpMaxY = this.drag_maxY - dragObj.offsetHeight;
if(topPos > tmpMaxY)topPos = tmpMaxY;
if(topPos < this.drag_minY)topPos = this.drag_minY;
}
dragObj.style.top = topPos + 'px';
}
this.dragInProgress = false;
return false;
}
,
__stopDragProcess:function(e)
{
if(this.dragDropTimer<5)return false;
if(document.all)e = event;
var dropDestination = DHTMLSuite.commonObj.getSrcElement(e);
var leftPosMouse = e.clientX + Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
var topPosMouse = e.clientY + Math.max(document.body.scrollTop,document.documentElement.scrollTop);
if(!this.dragDropTargetArray)this.dragDropTargetArray = new Array();
for(var no=0;no<this.dragDropTargetArray.length;no++){
var leftPosEl = DHTMLSuite.commonObj.getLeftPos(this.dragDropTargetArray[no][0]);
var topPosEl = DHTMLSuite.commonObj.getTopPos(this.dragDropTargetArray[no][0]);
var widthEl = this.dragDropTargetArray[no][0].offsetWidth;
var heightEl = this.dragDropTargetArray[no][0].offsetHeight;
if(leftPosMouse > leftPosEl && leftPosMouse < (leftPosEl + widthEl) && topPosMouse > topPosEl && topPosMouse < (topPosEl + heightEl)){
if(this.dragDropTargetArray[no][1]){
try{
eval(this.dragDropTargetArray[no][1] + '("' + this.dragDropSourcesArray[this.numericIdToBeDragged][0].id + '","' + this.dragDropTargetArray[no][0].id + '",' + e.clientX + ',' + e.clientY + ')');
}catch(e){
alert('Unable to execute \n' + this.dragDropTargetArray[no][1] + '("' + this.dragDropSourcesArray[this.numericIdToBeDragged][0].id + '","' + this.dragDropTargetArray[no][0].id + '",' + e.clientX + ',' + e.clientY + ')');
}
}
break;
}
}
if(this.dragDropSourcesArray[this.numericIdToBeDragged][1]){
this.__slideElementBackIntoItsOriginalPosition(this.numericIdToBeDragged);
}
this.dragDropTimer = -1;
DHTMLSuite.commonObj.__setOkToMakeTextSelections(true);
this.numericIdToBeDragged = false;
}
,
__slideElementBackIntoItsOriginalPosition:function(numId)
{
var currentX = this.dragObjCloneArray[numId].style.left.replace('px','')/1;
var currentY = this.dragObjCloneArray[numId].style.top.replace('px','')/1;
var targetX = DHTMLSuite.commonObj.getLeftPos(this.dragDropSourcesArray[numId][0]);
var targetY = DHTMLSuite.commonObj.getTopPos(this.dragDropSourcesArray[numId][0]);;
if(this.moveBackBySliding){
this.__processSlideByPixels(numId,currentX,currentY,targetX,targetY);
}else{
this.dragObjCloneArray[numId].style.display='none';
this.dragDropSourcesArray[numId][0].style.visibility = 'visible';
}
}
,
__processSlideByPixels:function(numId,currentX,currentY,targetX,targetY)
{
var slideX = Math.round(Math.abs(Math.max(currentX,targetX) - Math.min(currentX,targetX)) / 10);
var slideY = Math.round(Math.abs(Math.max(currentY,targetY) - Math.min(currentY,targetY)) / 10);
if(slideY<3 && Math.abs(slideX)<10)slideY = 3;	// 3 is minimum slide value
if(slideX<3 && Math.abs(slideY)<10)slideX = 3;	// 3 is minimum slide value
if(currentX > targetX) slideX*=-1;	// If current x is larger than target x, make slide value negative<br>
if(currentY > targetY) slideY*=-1;	// If current y is larger than target x, make slide value negative
currentX = currentX + slideX;
currentY = currentY + slideY;
if(Math.max(currentX,targetX) - Math.min(currentX,targetX) < 4)currentX = targetX;
if(Math.max(currentY,targetY) - Math.min(currentY,targetY) < 4)currentY = targetY;
this.dragObjCloneArray[numId].style.left = currentX + 'px';
this.dragObjCloneArray[numId].style.top = currentY + 'px';
if(currentX!=targetX || currentY != targetY){
window.thisRef = this;	// Reference to this dragdrop object
setTimeout('window.thisRef.__processSlideByPixels("' + numId + '",' + currentX + ',' + currentY + ',' + targetX + ',' + targetY + ')',5);
}else{	// Slide completed. Make absolute positioned element invisible and original element visible
this.dragObjCloneArray[numId].style.display='none';
this.dragDropSourcesArray[numId][0].style.visibility = 'visible';
}
}
}
var refToTabViewObjects = new Array();	// Reference to objects of this class.
DHTMLSuite.tabView = function()
{
var textPadding;				// Tab spacing
var strictDocType ; 			// Using a strict document type, i.e. <!DOCTYPE>
var DHTMLSuite_tabObj;		// Reference to div surrounding the tab set
var activeTabIndex;				// Currently displayed tab(index - 0 = first tab)
var initActiveTabIndex;			// Initially displayed tab(index - 0 = first tab)
var ajaxObjects;				// Reference to ajax objects
var tabView_countTabs;
var tabViewHeight;
var tabSetParentId;				// Id of div surrounding the tab set.
var tabTitles;					// Tab titles
var width;						// width of tab view
var height;						// height of tab view
var layoutCSS;
var outsideObjectRefIndex;		// Which index of refToTabViewObjects refers to this object.
var maxNumberOfTabs;
var dynamicContentObj;
var closeButtons;
this.textPadding = 3;
this.strictDocType = true;
this.ajaxObjects = new Array();
this.tabTitles = new Array();
this.layoutCSS = 'tab-view.css';
this.maxNumberOfTabs = 6;
this.dynamicContentObj = false;
this.closeButtons = new Array();
try{
if(!standardObjectsCreated)DHTMLSuite.createStandardObjects();	// This line starts all the init methods
}catch(e){
alert('You need to include the dhtmlSuite-common.js file');
}
}
DHTMLSuite.tabView.prototype = {
init:function()
{
DHTMLSuite.commonObj.loadCSS(this.layoutCSS);
this.outsideObjectRefIndex = refToTabViewObjects.length;
refToTabViewObjects[this.outsideObjectRefIndex] = this;
try{
this.dynamicContentObj = new DHTMLSuite.dynamicContent();
}catch(e){
alert('You need to include DHTMLSuite-dynamicContent.js');
}
this.__initializeAndParseTabs(false,false);
}
,
getMaximumNumberOfTabs:function()
{
return this.maxNumberOfTabs;
}
,
setMaximumTabs:function(maximumNumberOfTabs)
{
this.maxNumberOfTabs = maximumNumberOfTabs;
}
,
setParentId:function(idOfParentHTMLElement)
{
this.tabSetParentId = idOfParentHTMLElement;
this.DHTMLSuite_tabObj = document.getElementById(idOfParentHTMLElement);
}
,
setWidth:function(newWidth)
{
this.width = newWidth;
}
,
setHeight:function(newHeight)
{
this.height = newHeight;
}
,
setIndexActiveTab:function(indexOfNewActiveTab)
{
this.initActiveTabIndex = indexOfNewActiveTab;
}
,
setTabTitles:function(titleOfTabs)
{
this.tabTitles = titleOfTabs;
}
,
setCloseButtons:function(closeButtons)
{
this.closeButtons = closeButtons;
}
,
createNewTab:function(parentId,tabTitle,tabContent,tabContentUrl,closeButton)
{
if(this.tabView_countTabs>=this.maxNumberOfTabs)return;	// Maximum number of tabs reached - return
var div = document.createElement('DIV');	// Create new tab content div.
div.className = 'DHTMLSuite_aTab';	// Assign new tab to CSS class DHTMLSuite_aTab
this.DHTMLSuite_tabObj.appendChild(div);			// Appending new tab content div to main tab view div
var tabId = this.__initializeAndParseTabs(true,tabTitle,closeButton);	// Call the init method in order to create tab header and tab images
if(tabContent)div.innerHTML = tabContent;	// Static tab content specified, put it into the new div
if(tabContentUrl){	// Get content from external file
this.dynamicContentObj.loadContent('tabView' + parentId +'_' + tabId,tabContentUrl);
}
}
,
deleteTab:function(tabLabel,tabIndex)
{
if(tabLabel){	// Delete tab by tab title
var index = this.getTabIndexByTitle(tabLabel);	// Get index of tab
if(index!=-1){	// Tab exists if index<>-1
this.deleteTab(false,index);
}
}else if(tabIndex>=0){	// Delete tab by tab index.
if(document.getElementB

⌨️ 快捷键说明

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