User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 426,486 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,226 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Javascript Problem....Simple for experts i guess.....

Join Date: Aug 2007
Posts: 20
Reputation: web_master is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
web_master web_master is offline Offline
Newbie Poster

Re: Javascript Problem....Simple for experts i guess.....

  #2  
May 5th, 2008
i figured it out myself:

i used the height vaiable i declared on top for comparing and inside divminus() and divplus()
and removed the hideInnerSlide() completely

CODE:

var active= 0;
var height= 0;

function toggle_visible(){
if(active==0){
	active = 1;
	divplus();
}
else if(active==1){
	active = 0;
	divminus();
}
}

function divminus(){
if(height>=1){
	height = height - 5;
	document.getElementById('slide_box').style.height = height + "px";
	if(height < 230){
		document.getElementById('marq_box').style.display="none";
	}
	window.setTimeout('divminus()',1);					
}
else{
	document.getElementById('slide_box').style.display="none";
}
}

function divplus(){
if(height <= 250){
	document.getElementById('slide_box').style.display="block";
	height = height + 5;
	document.getElementById('slide_box').style.height = height + "px";
	if(height > 240){
		document.getElementById('marq_box').style.display="block";
	}
	window.setTimeout('divplus()',1);
}
}

function hidePtr(){
shown = document.getElementById('pointer').style.visibility == "visible";
unshown= document.getElementById('pointer').style.visibility = "hidden";
if(shown){
	document.getElementById('pointer').style.visibility = "hidden";
}
else if(unshown)
{
	document.getElementById('pointer').style.visibility == "visible";
}
}
Reply With Quote  
All times are GMT -4. The time now is 4:46 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC