Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-06-2005, 07:49 AM   #1 (permalink)
seenu433
Registered User
 
Join Date: May 2005
Posts: 2
seenu433 is on a distinguished road
javascript for making layers visible

i am having two controls and i want to make the controls visible based on a
radiobutton click using javascript and div or layers concepts.
Is this possible
Please help me.
seenu433 is offline   Reply With Quote
Old 05-06-2005, 08:09 AM   #2 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 746
DJMaze is on a distinguished road
You mean something like on my website: http://dragonflycms.net (click on the small buttons in the sideblocks)
DJMaze is offline   Reply With Quote
Old 05-06-2005, 08:17 AM   #3 (permalink)
seenu433
Registered User
 
Join Date: May 2005
Posts: 2
seenu433 is on a distinguished road
yes that would help
seenu433 is offline   Reply With Quote
Old 05-06-2005, 09:21 AM   #4 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 746
DJMaze is on a distinguished road
the javascript
Code:
function blockswitch(bid) {
  var bpe  = document.getElementById('pe'+bid);
  var bico = document.getElementById('pic'+bid);
  if (bpe && bpe.style.display=="none") {
    bpe.style.display="";
    bico.src = bico.src.replace("plus.", "minus.");
  } elseif (bpe) {
    bpe.style.display="none"; }
    bico.src = bico.src.replace("minus.", "plus.");
  }
}
the html image which controls the div
Code:
<img alt="Toggle Content" title="Toggle Content" id="pic1" src="minus.gif" onclick="blockswitch('1');" style="cursor:pointer" />
the actual div
Code:
<div id="pe1">
      <!-- CONTENT HERE -->
</div>
change the '1' in "pic1", "pe1" and blockswitch('1') to anything you like.
"minus.gif" gets replaced by "plus.gif" if you click on the image.
document.getElementById() is supported by IE and FireFox.
DJMaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie cant figure out Javascript Error JediNewbie HTML, XML, Javascript, AJAX 8 04-17-2005 11:15 PM
javascript alert without refreshing? sde HTML, XML, Javascript, AJAX 2 06-30-2004 12:52 PM


All times are GMT -8. The time now is 01:47 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting