Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / September 2007



Tip: Looking for answers? Try searching our database.

DIV and visibility

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TheScarecrow - 15 Sep 2007 19:14 GMT
Is it possible to test to see if a DIV tag is visible?
CFMXPrGrmR - 16 Sep 2007 02:47 GMT
Do you mean with JavaScript or CF? With JS you can use either a function or an
inline check to modify visibility. I use the code below quite a bit, works well
in IE and Firefox.

<a href="##"
onClick="document.getElementById('tab01').style.display='block';document.getElem
entById('tab02').style.display='none';document.getElementById('tab03').style.dis
play='none';">Show 1</a>

<a href="##"
onClick="document.getElementById('tab01').style.display='none';document.getEleme
ntById('tab02').style.display='block';document.getElementById('tab03').style.dis
play='none';">Show 2</a>

<a href="##"
onClick="document.getElementById('tab01').style.display='none';document.getEleme
ntById('tab02').style.display='none';document.getElementById('tab03').style.disp
lay='block';">Show 3</a>

<div id="tab01" style="display:block; height:300; width:500px; overflow:
visible; background-color:silver; margin:0">1</div>

<div id="tab02" style="display:none; height:300; width:500px; overflow:
visible; background-color:gray; margin:0">2</div>

<div id="tab03" style="display:none; height:300; width:500px; overflow:
visible; background-color:teal; margin:0">3</div>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.