Jump to content

Recommended Posts

first ide like to say sorry if i posted this in the wrong place.

 

<SCRIPT language="JavaScript">
<!--
function showLayer(name) {
name.style.visibility = "visible";
}

function hideLayer(name) {
name.style.visibility = "hidden";
}
// -->
</SCRIPT>

Example click <span onclick="showLayer(thisone)" style="cursor:hand"><b>here</b></span><br>
<DIV id="thisone" style="position: top:100; left:10; absolute; visibility:hidden">Some text or other stuff
<br><a href="#null" style="cursor:hand" style="text-decoration:none;" onclick="hideLayer(thisone)">[ hide ]</a>
</DIV>
<p>

Example click <span onclick="showLayer(1thisone)" style="cursor:hand"><b>here</b></span><br>
<DIV id="1thisone" style="position: absolute; visibility:hidden">Some text or other stuff
<br><a href="#null" style="cursor:hand" style="text-decoration:none;" onclick="hideLayer(1thisone)">[ hide ]</a>
</DIV>
<p>

 

this is my code that works fine. my issue is i want to click it and the hidden text then pushes the text below already on show down the page , if you run the code above youll see the 1st hidden message opens over the top of the next line down where as i want it to push the text below it.

 

hope i make sense lol

Link to comment
https://forums.phpfreaks.com/topic/258390-extended-text-help-needed/
Share on other sites

simple substitution:

<script type="text/javascript">
function showLayer(name)
{
name.style.display = "block";
}

function hideLayer(name)
{
name.style.display = "none";
}
</script>

Example click <span onclick="showLayer(thisone)" style="cursor:hand"><b>here</b></span><br>
<div id="thisone" style="position: top:100; left:10; absolute;display:none;">
Some text or other stuff
<br>
<a href="#null" style="cursor:hand" style="text-decoration:none;" onclick="hideLayer(thisone)">[ hide ]
</a>
</div>
<p>

Example click <span onclick="showLayer(sone)" style="cursor:hand"><b>here</b></span><br>
<div id="sone" style="position: absolute; display:none;">Some text or other stuff
<br><a href="#null" style="cursor:hand" style="text-decoration:none;" onclick="hideLayer(sone)">[ hide ]</a>
</div>
<p>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.