Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 08-24-2006, 08:07 PM show / hide help
Skilled Talker

Posts: 97
Trades: 0
hi, i am interested in using show / hide with javascript
and i came across this:
Code:
 <!-- in HEAD of document -->
<script language="javascript">
<!--
var state = 'hidden';

function showhide(layer_ref) {

if (state == 'visible') {
state = 'hidden';
}
else {
state = 'visible';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.visibility = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].visibility = state;
}
if (document.getElementById && !document.all) {
maxwell_smart = document.getElementById(layer_ref);
maxwell_smart.style.visibility = state;
}
}
//-->
</script>

<!-- CLICK LINK TO SHOW LAYER -->

<a href="javascript://" onclick="showhide('agent99');">click me</a>

<!-- in BODY of document -->

<div id="agent99" style="position:absolute; top:103px; left:153px;
visibility:hidden;">
your stuff to show here
</div>
and it works like how i want it but it leaves a big empty space which is for the content inside the <div>

is there someway to not have the white space
and just simply show the content of the div kinda like these sites

blog好き

and this show spoiler tag
AnimeSuki Forum - View Single Post - [Manga] Chapter 320 Discussion

thx
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
raptrex is offline
Reply With Quote
View Public Profile Visit raptrex's homepage!
 
 
Register now for full access!
Old 08-25-2006, 06:49 AM Re: show / hide help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
use display = "block" and display = "none" instead of visibility
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-25-2006, 08:19 AM Re: show / hide help
Skilled Talker

Posts: 97
Trades: 0
could you be a bit more specific?
do i put this as the style? style="display:block; display:none;"
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
raptrex is offline
Reply With Quote
View Public Profile Visit raptrex's homepage!
 
Old 08-25-2006, 08:38 AM Re: show / hide help
saadatshah's Avatar
Extreme Talker

Posts: 215
Name: Syed Saadat Ali
Location: Lahore, Pakistan
Trades: 0
Yes
__________________
- -- --- ---- ----- ------ ------- ---------------
If you have knowledge, let others light their candles in it.

Last edited by saadatshah; 08-25-2006 at 08:40 AM..
saadatshah is offline
Reply With Quote
View Public Profile Visit saadatshah's homepage!
 
Old 08-25-2006, 06:15 PM Re: show / hide help
kIDJOE's Avatar
Extreme Talker

Posts: 186
Location: Hollywood, CA
Trades: 0
not only that try my script and you can set the position of your div anywhere in the screen.

sorry forgot to add link, Here:

http://www.runapp.com/exold/sites/fi...eshow/joe.html
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

kIDJOE is offline
Reply With Quote
View Public Profile Visit kIDJOE's homepage!
 
Old 08-26-2006, 06:19 AM Re: show / hide help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by raptrex View Post
could you be a bit more specific?
do i put this as the style? style="display:block; display:none;"
Not quite.

instead of visibility:hidden use display:none and for visibility:visible use display:block


with visibility:hidden the element will still take up the same space in the document just simply not be seen. By using display:none the element is not shown and will take up no space at all.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to show / hide help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.34073 seconds with 12 queries