php javascript tabblad vraag

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Robert  dat ben ik

Robert dat ben ik

23/12/2009 23:18:00
Quote Anchor link
Mijn code ziet er als volgt uit:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<script language="javascript">
 function openTab(pTabPage,pTab){
  document.getElementById('mem_profiel').style.display = 'none';
  document.getElementById('mem_buddys').style.display = 'none';
  document.getElementById('mem_about').style.display = 'none';
  document.getElementById('mem_book').style.display = 'none';
  document.getElementById(pTabPage).style.display = 'block';
  document.getElementById('tab1').style.background = '';
  document.getElementById('tab1').style.fontWeight = 'normal';
  document.getElementById('tab2').style.background = '';
  document.getElementById('tab2').style.fontWeight = 'normal';
  document.getElementById('tab3').style.background = '';
  document.getElementById('tab3').style.fontWeight = 'normal';
  document.getElementById('tab4').style.background = '';
  document.getElementById('tab4').style.fontWeight = 'normal';
  document.getElementById(pTab).style.background = 'url(\'images/thema/tab_info_arrow.gif\') bottom no-repeat';
  document.getElementById(pTab).style.fontWeight = 'bold';
 }
 </script>
 <div style="width:100%; height:25px; background:url('images/tab_info_bg.jpg') repeat-x; font-family:arial; font-size:12px;">
  <div id="tab1" style="float:left; height:26px; margin:0px; padding:0px; margin-left: 5px; background:url('images/thema/tab_info_arrow.gif') bottom no-repeat; font-weight:bold;"><a href="#" onclick="openTab('mem_profiel','tab1'); return false">Profiel</a></div>
  <div id="tab1" style="float:left; height:26px; margin:0px; padding:0px; margin-left: 5px;">|</div>
  <div id="tab2" style="float:left; height:26px; margin:0px; padding:0px; margin-left: 5px;"><a href="#" onclick="openTab('mem_buddys','tab2'); return false">Vrienden</a></div>
  <div id="tab2" style="float:left; height:26px; margin:0px; padding:0px; margin-left: 5px;">|</div>
  <div id="tab3" style="float:left; height:26px; margin:0px; padding:0px; margin-left: 5px;"><a href="#" onclick="openTab('mem_about','tab3'); return false">Verhaal</a></div>
  <div id="tab3" style="float:left; height:26px; margin:0px; padding:0px; margin-left: 5px;">|</div>
  <div id="tab4" style="float:left; height:26px; margin:0px; padding:0px; margin-left: 5px;"><a href="#" onclick="openTab('mem_book','tab4'); return false">Membersboek</a></div>
  <div id="tab4" style="float:left; height:26px; margin:0px; padding:0px; margin-left: 5px;"></div>
 </div>
 
 <div id="mem_profiel">
  <div style="padding:10px; padding-top:4px;">
   pagina
  </div>
 </div>

 <div id="mem_buddys">
  <div style="padding:10px; padding-top:4px;">
   pagina
  </div>
 </div>

 <div id="mem_about">
  <div style="padding:10px; padding-top:4px;">
   pagina
  </div>
 </div>

 <div id="mem_book">
  <div style="padding:10px; padding-top:4px;">
   pagina

  </div>
 </div>

 


als ik op de zelfde pagina kom en ik klik een van de linken werkt het prima

nu wil ik dus ook dat ik via een andere pagina een van de 4 tabs kan openen

maar hoe kan ik dat het beste doen?

als ik op de pagina ben waar de tabs staan gebruik ik dit:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
<a href="#" onclick="openTab('mem_book','tab4'); return false">Membersboek</a>
 



als ik via een andere pagina naar de tab vrienden wil welke commandow heb ik nodig?


dit werkt niet:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
<a href="profiel/$id/" onclick="openTab('mem_book','tab4'); return false">Membersboek</a>
 



hoe kan dit wel werken??

greetz MaDHouSe
 
Er zijn nog geen reacties op dit bericht.



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.