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 401,961 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,873 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
Views: 544 | Replies: 1 | Solved
Reply
Join Date: Feb 2008
Posts: 7
Reputation: adrumsolo4u is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
adrumsolo4u adrumsolo4u is offline Offline
Newbie Poster

"if" suggestions

  #1  
Mar 2nd, 2008
i have three "buttons". when each is pressed i want to 1.) detect if it is not hidden, if so, return (do nothing). 2.) detect if another button is not hidden, if so i want it to hide that button and continue to the third. 3.) i want it to perform an action slidedown() which makes it not hidden.

i came up with this code.
  1. function toggleSlide(objname){
  2. if(document.getElementById(objname).style.display != "none")return;
  3. if(document.getElementById('mainA').style.display != "none")
  4. slideup('mainA');
  5. if(document.getElementById('mainB').style.display != "none")
  6. slideup('mainB');
  7. if(document.getElementById('mainC').style.display != "none")
  8. slideup('mainC');
  9. if(document.getElementById(objname).style.display == "none")
  10. slidedown(objname);
  11. }

very simple, and it works. However, i wanted it to complete the second task of checking if 'mainA' 'mainB' or 'mainC' had been pressed and WAIT for that to finish until moving on to step three. But that did not happen. it wasn't too pretty.
i tried a way of doing this, but needless to say it didn't work. any suggestions?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Posts: 7
Reputation: adrumsolo4u is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
adrumsolo4u adrumsolo4u is offline Offline
Newbie Poster

Re: "if" suggestions

  #2  
Mar 3rd, 2008
nevermind, i figured it out. just a little slow on the uptake of interval time delays with variables involved.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 6:19 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC