Toon posts:

[javascript] Toggle hide

Pagina: 1
Acties:
  • 49 views sinds 30-01-2008

Verwijderd

Topicstarter
Ey,
ik heb nu dit scriptje op m'n site staan:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<script type="text/javascript">
<!--
// toggle visibility

function toggle( targetId ){
  if (document.getElementById){
        target = document.getElementById( targetId );
           if (target.style.display == "none"){
              target.style.display = "";
           } else {
              target.style.display = "none";
           }
     }
}
-->


code:
1
2
3
<a href="#" onclick="toggle('outside2');return false;" title="Toggle BlogRoll">
laat zien/verberg</a>
<div id="outside2"> inhoud </div>


Maar nu zou ik het graag zo willen dat hij bij het laden van de pagina automatisch op 'verberg' staat ipv 'laat zien'.

Hoe doe ik dit?

Alvast bedankt!

  • djluc
  • Registratie: Oktober 2002
  • Laatst online: 13:32
HTML:
1
<div id="outside2" style="display: none;">
offtopic:
Erg snel Janoz!

[ Voor 68% gewijzigd door djluc op 28-07-2004 15:02 ]


  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 09:13

Janoz

Moderator Devschuur®

!litemod

Dit hoort in Webdesign & Graphics en niet in Programming & Webscripting. Volgende keer ieetsje beter opletten ;)

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


  • Bosmonster
  • Registratie: Juni 2001
  • Laatst online: 10-05 18:53

Bosmonster

*zucht*

/basic...

Dit topic is gesloten.