Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Javascript Problem help!!!

    i want this script to work twice

    Code:
    	<script type="text/javascript">
    	
    	/************************************************************************************************************
    	(C) www.dhtmlgoodies.com, October 2005
    	
    	Version 1.2: Updated, November 12th. 2005
    	
    	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	
    	
    	Terms of use:
    	You are free to use this script as long as the copyright message is kept intact. However, you may not
    	redistribute, sell or repost it without our permission.
    	
    	Thank you!
    	
    	www.dhtmlgoodies.com
    	Alf Magne Kalleland
    	
    	************************************************************************************************************/		
    	var panelWidth = 150;	// Width of help panel	
    	var slideSpeed = 15;		// Higher = quicker slide
    	var slideTimer = 10;	// Lower = quicker slide
    	var slideActive = true;	// Slide active ?
    	var initBodyMargin = 0;	// Left or top margin of your <body> tag (left if panel is at the left, top if panel is on the top)
    	var pushMainContentOnSlide = false;	// Push your main content to the right when sliding
    	var panelPosition = 0; 	// 0 = left , 1 = top
    	
    	/*	Don't change these values */
    	var slideLeftPanelObj=false;
    	var slideInProgress = false;	
    	var startScrollPos = false;
    	var panelVisible = false;
    	function initSlideLeftPanel(expandOnly)
    	{
    		if(slideInProgress)return;
    		if(!slideLeftPanelObj){
    			if(document.getElementById('dhtmlgoodies_leftPanel')){	// Object exists in HTML code?
    				slideLeftPanelObj = document.getElementById('dhtmlgoodies_leftPanel');
    				if(panelPosition == 1)slideLeftPanelObj.style.width = '100&#37;';
    			}else{	// Object doesn't exist -> Create <div> dynamically
    				slideLeftPanelObj = document.createElement('DIV');
    				slideLeftPanelObj.id = 'dhtmlgoodies_leftPanel';
    				slideLeftPanelObj.style.display='none';
    				document.body.appendChild(slideLeftPanelObj);
    			}
    			
    			if(panelPosition == 1){
    				slideLeftPanelObj.style.top = "-" + panelWidth + 'px';
    				slideLeftPanelObj.style.left = '0px';	
    				slideLeftPanelObj.style.height = panelWidth + 'px';			
    			}else{
    				slideLeftPanelObj.style.left = "-" + panelWidth + 'px';
    				slideLeftPanelObj.style.top = '0px';
    				slideLeftPanelObj.style.width = panelWidth + 'px';
    			}
    			
    
    			if(!document.all || navigator.userAgent.indexOf('Opera')>=0)slideLeftPanelObj.style.position = 'fixed';;
    		}	
    		
    		if(panelPosition == 0){
    			if(document.documentElement.clientHeight){
    				slideLeftPanelObj.style.height = document.documentElement.clientHeight + 'px';
    			}else if(document.body.clientHeight){
    				slideLeftPanelObj.style.height = document.body.clientHeight + 'px';
    			}
    			var leftPos = slideLeftPanelObj.style.left.replace(/[^0-9\-]/g,'')/1;
    		}else{
    			if(document.documentElement.clientWidth){
    				slideLeftPanelObj.style.width = document.documentElement.clientWidth + 'px';
    			}else if(document.body.clientHeight){
    				slideLeftPanelObj.style.width = document.body.clientWidth + 'px';
    			}
    			var leftPos = slideLeftPanelObj.style.top.replace(/[^0-9\-]/g,'')/1;			
    			
    			
    		}
    		slideLeftPanelObj.style.display='block';
    		
    		if(panelPosition==1)
    			startScrollPos = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
    		else
    			startScrollPos = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
    		if(leftPos<(0+startScrollPos)){
    			if(slideActive){
    				slideLeftPanel(slideSpeed);	
    			
    			}else{
    				document.body.style.marginLeft = panelWidth + 'px';
    				slideLeftPanelObj.style.left = '0px';
    			}
    		}else{
    			if(expandOnly)return;
    			if(slideActive){		
    				slideLeftPanel(slideSpeed*-1);
    			}else{
    				if(panelPosition == 0){
    					if(pushMainContentOnSlide)document.body.style.marginLeft =  initBodyMargin + 'px';
    					slideLeftPanelObj.style.left = (panelWidth*-1) + 'px';	
    				}else{
    					if(pushMainContentOnSlide)document.body.style.marginTop =  initBodyMargin + 'px';
    					slideLeftPanelObj.style.top = (panelWidth*-1) + 'px';						
    				}			
    			}
    		}	
    		
    		if(navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('Opera')<0){
    			window.onscroll = repositionHelpDiv;
    		
    			repositionHelpDiv();
    		}
    		window.onresize = resizeLeftPanel;
    		
    	}
    	
    	function resizeLeftPanel()
    	{
    		if(panelPosition == 0){
    			if(document.documentElement.clientHeight){
    				slideLeftPanelObj.style.height = document.documentElement.clientHeight + 'px';
    			}else if(document.body.clientHeight){
    				slideLeftPanelObj.style.height = document.body.clientHeight + 'px';
    			}		
    		}else{
    			if(document.documentElement.clientWidth){
    				slideLeftPanelObj.style.width = document.documentElement.clientWidth + 'px';
    			}else if(document.body.clientWidth){
    				slideLeftPanelObj.style.width = document.body.clientWidth + 'px';
    			}	
    		}
    	}
    	
    	function slideLeftPanel(slideSpeed){
    		slideInProgress =true;
    		var scrollValue = 0;
    		if(panelPosition==1)
    			var leftPos = slideLeftPanelObj.style.top.replace(/[^0-9\-]/g,'')/1;
    		else
    			var leftPos = slideLeftPanelObj.style.left.replace(/[^0-9\-]/g,'')/1;
    			
    		leftPos+=slideSpeed;
    		okToSlide = true;
    		if(slideSpeed<0){
    			if(leftPos < ((panelWidth*-1) + startScrollPos)){
    				leftPos = (panelWidth*-1) + startScrollPos;	
    				okToSlide=false;
    			}
    		}
    		if(slideSpeed>0){
    			if(leftPos > (0 + startScrollPos)){
    				leftPos = 0 + startScrollPos;
    				okToSlide = false;
    			}			
    		}
    		
    		
    		if(panelPosition==0){
    			slideLeftPanelObj.style.left = leftPos + startScrollPos + 'px';
    			if(pushMainContentOnSlide)document.body.style.marginLeft = leftPos - startScrollPos + panelWidth + 'px';
    		}else{
    			slideLeftPanelObj.style.top = leftPos + 'px';
    			if(pushMainContentOnSlide)document.body.style.marginTop = leftPos - startScrollPos + panelWidth + 'px';			
    			
    		}
    		if(okToSlide)setTimeout('slideLeftPanel(' + slideSpeed + ')',slideTimer); else {
    			slideInProgress = false;
    			if(slideSpeed>0)panelVisible=true; else panelVisible = false;
    		}
    		
    	}
    	
    	
    	function repositionHelpDiv()
    	{
    		if(panelPosition==0){
    			var maxValue = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
    			slideLeftPanelObj.style.top = maxValue;
    		}else{
    			var maxValue = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
    			slideLeftPanelObj.style.left = maxValue;	
    			var maxTop = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
    			if(!slideInProgress)slideLeftPanelObj.style.top = (maxTop - (panelVisible?0:panelWidth)) + 'px'; 		
    		}
    	}
    	
    	function cancelEvent()
    	{
    		return false;
    	}
    	function keyboardShowLeftPanel()
    	{
    			initSlideLeftPanel();
    			return false;	
    	
    	}
    	
    	function leftPanelKeyboardEvent(e)
    	{
    		if(document.all)return;
    		
    		if(e.keyCode==112){
    			initSlideLeftPanel();
    			return false;
    		}		
    	}
    	
    	function setLeftPanelContent(text)
    	{
    		document.getElementById('leftPanelContent').innerHTML = text;
    		initSlideLeftPanel(true);
    		
    	}
    	if(!document.all)document.documentElement.onkeypress = leftPanelKeyboardEvent;
    	document.documentElement.onhelp  = keyboardShowLeftPanel;
    
    	</script>
    </head>
    <body>
    
    <!-- Code for the left panel -->
    <div id="dhtmlgoodies_leftPanel">
    	<a class="closeLink" href="#" onclick="initSlideLeftPanel();return false">Close</a>
    	<div id="leftPanelContent">
    	<!-- This is the content -->
    	<img src="images/bg.gif">
    	<div>
    		<p>To accomplish this, do this:</p>
    		<ul>
    
    			<li>Click on key A</li>
    			<li>Open the bla bla window</li>
    			<li>Enter your name in the first text box</li>
    			<li>Save your changes</li>
    		</ul>
    	</div>
    	<!-- End content -->
    
    	</div>
    </div>
    <!-- End code for the left panel -->
    in action
    left-right = http://www.dhtmlgoodies.com/scripts/...n-pane-d2.html
    up-down = http://www.dhtmlgoodies.com/scripts/...n-pane-d4.html


    1 goin up and down the other ging left and right.


    plz help i've been lookin for help for ages
    Last edited by navaun22; 06-19-2008 at 05:50 PM. Reason: complaint

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    1 goin up and down the other ging left and right.


    plz help i've been lookin for help for ages
    You'd get some quick help if you draft your question in a proper manner. Also please follow http://www.codingforums.com/showthread.php?t=82672, a thread on how to post javascript code in this forum (you may edit your post)
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry im new to this forum

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,314
    Thanks
    203
    Thanked 2,564 Times in 2,542 Posts
    You cannot have two scripts with the same function and/or variable names on the same page, as the second simply over-writes the first.

  • #5
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    even if use src because they will b in different js files

  • #6
    New Coder
    Join Date
    Apr 2005
    Location
    Massachusetts, US
    Posts
    37
    Thanks
    5
    Thanked 0 Times in 0 Posts
    You'll need to go through the file, make a second copy, and just change all the function and variable names. It doesn't matter if they're in two different JS files, calling them externally like that is just another way of putting the code on your website.

  • #7
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    k i'll try
    ithought it was only variable names i had to change

  • #8
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    wot about the div

  • #9
    New Coder
    Join Date
    Apr 2005
    Location
    Massachusetts, US
    Posts
    37
    Thanks
    5
    Thanked 0 Times in 0 Posts
    You'll likely need new ID's and class names for the DIVs as well.

  • #10
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    y class name

  • #11
    New Coder
    Join Date
    Apr 2005
    Location
    Massachusetts, US
    Posts
    37
    Thanks
    5
    Thanked 0 Times in 0 Posts
    If the script calls a reference to anything that shares a name with an element that already exists (be it a class, ID, variable, function, etc), it will mess up. You need to make sure that when menu script #1 calls a style change to an ID or a class, that that same ID or class is not also referenced and changed by menu script #2.

  • #12
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it still don't work properly

    hav a look

    Code:
    <html>
    <head>
    <title>Test Menu</title>
    
    <script type="text/javascript">
    	
    	/************************************************************************************************************
    	(C) www.dhtmlgoodies.com, October 2005
    	
    	Version 1.2: Updated, November 12th. 2005
    	
    	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	
    	
    	Terms of use:
    	You are free to use this script as long as the copyright message is kept intact. However, you may not
    	redistribute, sell or repost it without our permission.
    	
    	Thank you!
    	
    	www.dhtmlgoodies.com
    	Alf Magne Kalleland
    	
    	************************************************************************************************************/		
    	var paneWidth = 150;	// Width of help panel	
    	var slideSpd = 15;		// Higher = quicker slide
    	var slideTimr = 10;	// Lower = quicker slide
    	var slideAct = true;	// Slide active ?
    	var initBodyMrg = 0;	// Left or top margin of your <body> tag (left if panel is at the left, top if panel is on the top)
    	var pushMainContentOnSde = false;	// Push your main content to the right when sliding
    	var panelPos = 0; 	// 0 = left , 1 = top
    	
    	/*	Don't change these values */
    	var slideLtPanelObj=false;
    	var slideInProg = false;	
    	var startScrlPos = false;
    	var paneVisib = false;
    	function initSlideLtPanel(expandOnly)
    	{
    		if(slideInProg)return;
    		if(!slideLtPanelObj){
    			if(document.getElementById('dhtmlgdies_ltPanel')){	// Object exists in HTML code?
    				slideLtPanelObj = document.getElementById('dhtmlgoodies_leftPanel');
    				if(panelPos == 1)slideLtPanelObj.style.width = '100%';
    			}else{	// Object doesn't exist -> Create <div> dynamically
    				slideLtPanelObj = document.createElement('DIV');
    				slideLtPanelObj.id = 'dhtmlgoodies_leftPanel';
    				slideLtPanelObj.style.display='none';
    				document.body.appendChild(slideLtPanelObj);
    			}
    			
    			if(panelPos == 1){
    				slideLtPanelObj.style.top = "-" + paneWidth + 'px';
    				slideLtPanelObj.style.left = '0px';	
    				slideLtPanelObj.style.height = paneWidth + 'px';			
    			}else{
    				slideLtPanelObj.style.left = "-" + paneWidth + 'px';
    				slideLtPanelObj.style.top = '0px';
    				slideLtPanelObj.style.width = paneWidth + 'px';
    			}
    			
    
    			if(!document.all || navigator.userAgent.indexOf('Opera')>=0)slideLtPanelObj.style.position = 'fixed';;
    		}	
    		
    		if(panelPos == 0){
    			if(document.documentElement.clientHeight){
    				slideLtPanelObj.style.height = document.documentElement.clientHeight + 'px';
    			}else if(document.body.clientHeight){
    				slideLtPanelObj.style.height = document.body.clientHeight + 'px';
    			}
    			var ltPos = slideLtPanelObj.style.left.replace(/[^0-9\-]/g,'')/1;
    		}else{
    			if(document.documentElement.clientWidth){
    				slideLtPanelObj.style.width = document.documentElement.clientWidth + 'px';
    			}else if(document.body.clientHeight){
    				slideLtPanelObj.style.width = document.body.clientWidth + 'px';
    			}
    			var ltPos = slideLtPanelObj.style.top.replace(/[^0-9\-]/g,'')/1;			
    			
    			
    		}
    		slideLtPanelObj.style.display='block';
    		
    		if(panelPos==1)
    			startScrlPos = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
    		else
    			startScrlPos = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
    		if(ltPos<(0+startScrlPos)){
    			if(slideAct){
    				slideLtPanel(slideSpd);	
    			
    			}else{
    				document.body.style.marginLeft = paneWidth + 'px';
    				slideLtPanelObj.style.left = '0px';
    			}
    		}else{
    			if(expandOnly)return;
    			if(slideAct){		
    				slideLtPanel(slideSpd*-1);
    			}else{
    				if(panelPos == 0){
    					if(pushMainContentOnSde)document.body.style.marginLeft =  initBodyMrg + 'px';
    					slideLtPanelObj.style.left = (paneWidth*-1) + 'px';	
    				}else{
    					if(pushMainContentOnSde)document.body.style.marginTop =  initBodyMrg + 'px';
    					slideLtPanelObj.style.top = (paneWidth*-1) + 'px';						
    				}			
    			}
    		}	
    		
    		if(navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('Opera')<0){
    			window.onscroll = reposHelpDiv;
    		
    			reposHelpDiv();
    		}
    		window.onresize = resizeLtPanel;
    		
    	}
    	
    	function resizeLtPanel()
    	{
    		if(panelPos == 0){
    			if(document.documentElement.clientHeight){
    				slideLtPanelObj.style.height = document.documentElement.clientHeight + 'px';
    			}else if(document.body.clientHeight){
    				slideLtPanelObj.style.height = document.body.clientHeight + 'px';
    			}		
    		}else{
    			if(document.documentElement.clientWidth){
    				slideLtPanelObj.style.width = document.documentElement.clientWidth + 'px';
    			}else if(document.body.clientWidth){
    				slideLtPanelObj.style.width = document.body.clientWidth + 'px';
    			}	
    		}
    	}
    	
    	function slideLtPanel(slideSpd){
    		slideInProg =true;
    		var scrollVal = 0;
    		if(panelPos==1)
    			var ltPos = slideLtPanelObj.style.top.replace(/[^0-9\-]/g,'')/1;
    		else
    			var ltPos = slideLtPanelObj.style.left.replace(/[^0-9\-]/g,'')/1;
    			
    		ltPos+=slideSpd;
    		okToSlide = true;
    		if(slideSpd<0){
    			if(ltPos < ((paneWidth*-1) + startScrlPos)){
    				ltPos = (paneWidth*-1) + startScrlPos;	
    				okToSlide=false;
    			}
    		}
    		if(slideSpd>0){
    			if(ltPos > (0 + startScrlPos)){
    				ltPos = 0 + startScrlPos;
    				okToSlide = false;
    			}			
    		}
    		
    		
    		if(panelPos==0){
    			slideLtPanelObj.style.left = ltPos + startScrlPos + 'px';
    			if(pushMainContentOnSde)document.body.style.marginLeft = ltPos - startScrlPos + paneWidth + 'px';
    		}else{
    			slideLtPanelObj.style.top = ltPos + 'px';
    			if(pushMainContentOnSde)document.body.style.marginTop = ltPos - startScrlPos + paneWidth + 'px';			
    			
    		}
    		if(okToSlide)setTimeout('slideLtPanel(' + slideSpd + ')',slideTimr); else {
    			slideInProg = false;
    			if(slideSpd>0)paneVisib=true; else paneVisib = false;
    		}
    		
    	}
    	
    	
    	function reposHelpDiv()
    	{
    		if(panelPos==0){
    			var maxVal = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
    			slideLtPanelObj.style.top = maxVal;
    		}else{
    			var maxVal = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
    			slideLtPanelObj.style.left = maxVal;	
    			var maxTp = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
    			if(!slideInProg)slideLtPanelObj.style.top = (maxTp - (paneVisib?0:paneWidth)) + 'px'; 		
    		}
    	}
    	
    	function cancelEvnt()
    	{
    		return false;
    	}
    	function keyboardShowLtPanel()
    	{
    			initSlideLtPanel();
    			return false;	
    	
    	}
    	
    	function leftPanelKeyboardEvnt(e)
    	{
    		if(document.all)return;
    		
    		if(e.keyCode==113){
    			initSlideLtPanel();
    			return false;
    		}		
    	}
    	
    	function setLeftPanelCont(text)
    	{
    		document.getElementById('leftPanelContent').innerHTML = text;
    		initSlideLtPanel(true);
    		
    	}
    	if(!document.all)document.documentElement.onkeypress = leftPanelKeyboardEvnt;
    	document.documentElement.onhelp  = keyboardShowLtPanel;
    
    	</script>
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	<script type="text/javascript">
    	
    	/************************************************************************************************************
    	(C) www.dhtmlgoodies.com, October 2005
    	
    	Version 1.2: Updated, November 12th. 2005
    	
    	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	
    	
    	Terms of use:
    	You are free to use this script as long as the copyright message is kept intact. However, you may not
    	redistribute, sell or repost it without our permission.
    	
    	Thank you!
    	
    	www.dhtmlgoodies.com
    	Alf Magne Kalleland
    	
    	************************************************************************************************************/		
    	var panelWidth = 150;	// Width of help panel	
    	var slideSpeed = 15;		// Higher = quicker slide
    	var slideTimer = 10;	// Lower = quicker slide
    	var slideActive = true;	// Slide active ?
    	var initBodyMargin = 1;	// Left or top margin of your <body> tag (left if panel is at the left, top if panel is on the top)
    	var pushMainContentOnSlide = false;	// Push your main content to the right when sliding
    	var panelPosition = 1; 	// 0 = left , 1 = top
    	
    	/*	Don't change these values */
    	var slideLeftPanelObj=false;
    	var slideInProgress = false;	
    	var startScrollPos = false;
    	var panelVisible = false;
    	function initSlideLeftPanel(expandOnly)
    	{
    		if(slideInProgress)return;
    		if(!slideLeftPanelObj){
    			if(document.getElementById('dhtmlgdies_ltPanel')){	// Object exists in HTML code?
    				slideLeftPanelObj = document.getElementById('dhtmlgdies_ltPanel');
    				if(panelPosition == 1)slideLeftPanelObj.style.width = '100%';
    			}else{	// Object doesn't exist -> Create <div> dynamically
    				slideLeftPanelObj = document.createElement('DIV');
    				slideLeftPanelObj.id = 'dhtmlgdies_ltPanel';
    				slideLeftPanelObj.style.display='none';
    				document.body.appendChild(slideLeftPanelObj);
    			}
    			
    			if(panelPosition == 1){
    				slideLeftPanelObj.style.top = "-" + panelWidth + 'px';
    				slideLeftPanelObj.style.left = '0px';	
    				slideLeftPanelObj.style.height = panelWidth + 'px';			
    			}else{
    				slideLeftPanelObj.style.left = "-" + panelWidth + 'px';
    				slideLeftPanelObj.style.top = '0px';
    				slideLeftPanelObj.style.width = panelWidth + 'px';
    			}
    			
    
    			if(!document.all || navigator.userAgent.indexOf('Opera')>=0)slideLeftPanelObj.style.position = 'fixed';;
    		}	
    		
    		if(panelPosition == 0){
    			if(document.documentElement.clientHeight){
    				slideLeftPanelObj.style.height = document.documentElement.clientHeight + 'px';
    			}else if(document.body.clientHeight){
    				slideLeftPanelObj.style.height = document.body.clientHeight + 'px';
    			}
    			var leftPos = slideLeftPanelObj.style.left.replace(/[^0-9\-]/g,'')/1;
    		}else{
    			if(document.documentElement.clientWidth){
    				slideLeftPanelObj.style.width = document.documentElement.clientWidth + 'px';
    			}else if(document.body.clientHeight){
    				slideLeftPanelObj.style.width = document.body.clientWidth + 'px';
    			}
    			var leftPos = slideLeftPanelObj.style.top.replace(/[^0-9\-]/g,'')/1;			
    			
    			
    		}
    		slideLeftPanelObj.style.display='block';
    		
    		if(panelPosition==1)
    			startScrollPos = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
    		else
    			startScrollPos = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
    		if(leftPos<(0+startScrollPos)){
    			if(slideActive){
    				slideLeftPanel(slideSpeed);	
    			
    			}else{
    				document.body.style.marginLeft = panelWidth + 'px';
    				slideLeftPanelObj.style.left = '0px';
    			}
    		}else{
    			if(expandOnly)return;
    			if(slideActive){		
    				slideLeftPanel(slideSpeed*-1);
    			}else{
    				if(panelPosition == 0){
    					if(pushMainContentOnSlide)document.body.style.marginLeft =  initBodyMargin + 'px';
    					slideLeftPanelObj.style.left = (panelWidth*-1) + 'px';	
    				}else{
    					if(pushMainContentOnSlide)document.body.style.marginTop =  initBodyMargin + 'px';
    					slideLeftPanelObj.style.top = (panelWidth*-1) + 'px';						
    				}			
    			}
    		}	
    		
    		if(navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('Opera')<0){
    			window.onscroll = repositionHelpDiv;
    		
    			repositionHelpDiv();
    		}
    		window.onresize = resizeLeftPanel;
    		
    	}
    	
    	function resizeLeftPanel()
    	{
    		if(panelPosition == 0){
    			if(document.documentElement.clientHeight){
    				slideLeftPanelObj.style.height = document.documentElement.clientHeight + 'px';
    			}else if(document.body.clientHeight){
    				slideLeftPanelObj.style.height = document.body.clientHeight + 'px';
    			}		
    		}else{
    			if(document.documentElement.clientWidth){
    				slideLeftPanelObj.style.width = document.documentElement.clientWidth + 'px';
    			}else if(document.body.clientWidth){
    				slideLeftPanelObj.style.width = document.body.clientWidth + 'px';
    			}	
    		}
    	}
    	
    	function slideLeftPanel(slideSpeed){
    		slideInProgress =true;
    		var scrollValue = 0;
    		if(panelPosition==1)
    			var leftPos = slideLeftPanelObj.style.top.replace(/[^0-9\-]/g,'')/1;
    		else
    			var leftPos = slideLeftPanelObj.style.left.replace(/[^0-9\-]/g,'')/1;
    			
    		leftPos+=slideSpeed;
    		okToSlide = true;
    		if(slideSpeed<0){
    			if(leftPos < ((panelWidth*-1) + startScrollPos)){
    				leftPos = (panelWidth*-1) + startScrollPos;	
    				okToSlide=false;
    			}
    		}
    		if(slideSpeed>0){
    			if(leftPos > (0 + startScrollPos)){
    				leftPos = 0 + startScrollPos;
    				okToSlide = false;
    			}			
    		}
    		
    		
    		if(panelPosition==0){
    			slideLeftPanelObj.style.left = leftPos + startScrollPos + 'px';
    			if(pushMainContentOnSlide)document.body.style.marginLeft = leftPos - startScrollPos + panelWidth + 'px';
    		}else{
    			slideLeftPanelObj.style.top = leftPos + 'px';
    			if(pushMainContentOnSlide)document.body.style.marginTop = leftPos - startScrollPos + panelWidth + 'px';			
    			
    		}
    		if(okToSlide)setTimeout('slideLeftPanel(' + slideSpeed + ')',slideTimer); else {
    			slideInProgress = false;
    			if(slideSpeed>0)panelVisible=true; else panelVisible = false;
    		}
    		
    	}
    	
    	
    	function repositionHelpDiv()
    	{
    		if(panelPosition==0){
    			var maxValue = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
    			slideLeftPanelObj.style.top = maxValue;
    		}else{
    			var maxValue = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
    			slideLeftPanelObj.style.left = maxValue;	
    			var maxTop = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
    			if(!slideInProgress)slideLeftPanelObj.style.top = (maxTop - (panelVisible?0:panelWidth)) + 'px'; 		
    		}
    	}
    	
    	function cancelEvent()
    	{
    		return false;
    	}
    	function keyboardShowLeftPanel()
    	{
    			initSlideLeftPanel();
    			return false;	
    	
    	}
    	
    	function leftPanelKeyboardEvent(e)
    	{
    		if(document.all)return;
    		
    		if(e.keyCode==114){
    			initSlideLeftPanel();
    			return false;
    		}		
    	}
    	
    	function setLeftPanelContent(text)
    	{
    		document.getElementById('leftPanelContent').innerHTML = text;
    		initSlideLeftPanel(true);
    		
    	}
    	if(!document.all)document.documentElement.onkeypress = leftPanelKeyboardEvent;
    	document.documentElement.onhelp  = keyboardShowLeftPanel;
    
    	</script>
    
    	
    	
    </head>
    <body>
    
    <!-- Code for the left panel -->
    <div id="dhtmlgdies_ltPanel">
    	<a class="closeLink" href="#" onclick="initSlideLtPanel();return false">Close</a>
    	<div id="leftPanelContent">
    	<!-- This is the content -->
    	<img src="images/bg.gif">
    	<div>
    		<p>To accomplish this, do this:</p>
    		<ul>
    
    			<li>Click on key A</li>
    			<li>Open the bla bla window</li>
    			<li>Enter your name in the first text box</li>
    			<li>Save your changes</li>
    		</ul>
    	</div>
    	<!-- End content -->
    
    	</div>
    </div>
    <!-- End code for the left panel -->
    <div id="dhtmlgoodies_leftPanel">
    	<a class="closeLk" href="*" onclick="initSlideLeftPanel();return false">Close</a>
    	<div id="leftPanelContent">
    	<!-- This is the content -->
    	<img src="images/bg.gif">
    	<div>
    		<p>To accomplish this, do this:</p>
    		<ul>
    
    			<li>Click on key A</li>
    			<li>Open the bla bla window</li>
    			<li>Enter your name in the first text box</li>
    			<li>Save your changes</li>
    		</ul>
    	</div>
    	<!-- End content -->
    
    	</div>
    </div>
    
    </body>
    </html>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •