Jump to content


Photo

Show/hide layers


  • Please log in to reply
2 replies to this topic

#1 eyegraphix

eyegraphix
  • Members
  • PipPip
  • Member
  • 24 posts
  • LocationAmes, Iowa

Posted 19 October 2005 - 12:39 AM

Link: http://www.kjly.com/optiontest.php

I have a form and at the very bottom of it where it asks "Would you like to submit money now?" I have a radio button and when it is checked "yes" I'm using the dreamweaver behavior "show=hide layers" to reveal a hidden layer. All I want is for when the layer is shown, that the text and submit button move down when the layer is revealed. You can see now that it completely covers the button and text when the layer is revealed. I've tried a few things with no success. How can I accomplish this??


#2 eyegraphix

eyegraphix
  • Members
  • PipPip
  • Member
  • 24 posts
  • LocationAmes, Iowa

Posted 20 October 2005 - 02:40 PM

I really need help with this. Someone? Please?

#3 ChrisDarl

ChrisDarl
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 21 October 2005 - 03:32 PM

Basicly, use javascript

in the <head> tags put

<script type="text/javascript" language="javascript">

function showLayer() {
var aLayer = document.getElementById("layerID");

aLayer.style.display = "block"; or use aLayer.style.visibility = "visible";
}

function hideLayer () {
var aLayer = document.getElementById("layerID");

aLayer.style.display = "none"; or use aLayer.style.visibility = "hidden";
}

</script>

on the radio buttons add onClick event to each, for the yes onClick put onClick="javascript:showLayer();"
no : onClick="javascript:hideLayer();"

You'll need to have all the content that you want hiding/shown in a div tag, with an ID. in the Javascript code change the 'layerID' to the ID of your div tag.

if this doesnt work, let me know and ill actually run the code, might of slipped up somewhere. Hope it is of help.

Chris




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users