Mam stronkę w php. Z lewej strony mam menu: O nas, Oferta, i Kontakt.
screen1
Po kliknięciu na ofertę z prawej strony wyświetlają się informacje o produktach.
Zmodyfikowałam to jednak i po kliknięciu z lewej strony na ofertę, z prawej wyświeta się dodatkowe menu i przyciski:
oferta1, oferta2, oferta3.
screen2
To nowe menu i wyświetlanie go z prawej mam zrobione za pomoca takiego kodu"
<script type='text/javascript'> var PusteId = 0; var Oferta1Id = 1; var Oferta2Id = 2; var Oferta3Id = 3; var PageMax = 3; var Buttons = new Array(); var ButtonsHi = new Array(); var ButtonsSel = new Array(); for (var i = 0; i <= PageMax; i++) { Buttons[i] = new Image(); ButtonsHi[i] = new Image(); ButtonsSel[i] = new Image(); }; <?php include("subpages/sp_offer.php"); ?> var Pages = new Array(); Pages[PusteId] = PusteText; Pages[Oferta1Id] = Oferta1Text; Pages[Oferta2Id] = Oferta2Text; Pages[Oferta3Id] = Oferta3Text; var CurrentPage = 0; function SetButtonState (obj, id, isHovering) { if (id == CurrentPage) obj.src = ButtonsSel[id].src; else if (isHovering) obj.src = ButtonsHi[id].src; else obj.src = Buttons[id].src; } function InitButtonStates () { SetButtonState(document.getElementById('Oferta1Button'), Oferta1Id, false); SetButtonState(document.getElementById('Oferta2Button'), Oferta2Id, false); SetButtonState(document.getElementById('Oferta3Button'), Oferta3Id, false); } function ChangePage (id) { if (id > PageMax) return; CurrentPage = id; document.getElementById('offer_text').innerHTML = Pages[id]; InitButtonStates(); } </script> <div class="wybierz"> <div><img src='images/wybierz-pl.png' width='669' height='36' /></div> </div> <div class="content"> <div style="width:677px; height:38px"> <div style='width:221px; height:38px; left:0px; top:0px; position:absolute'><img id='Oferta1Button' onClick='java script:ChangePage(Oferta1Id)' onMouseOver='java script:SetButtonState(this, Oferta1Id, true)' onMouseOut='java script:SetButtonState(this, Oferta1Id, false)' style='cursor:pointer' alt='' /></div> <div style='width:221px; height:38px; left:225px; top:0px; position:absolute'><img id='Oferta2Button' onClick='java script:ChangePage(Oferta2Id)' onMouseOver='java script:SetButtonState(this, Oferta2Id, true)' onMouseOut='java script:SetButtonState(this, Oferta2Id, false)' style='cursor:pointer' alt='' /></div> <div style='width:221px; height:38px; left:450px; top:0px; position:absolute'><img id='Oferta3Button' onClick='java script:ChangePage(Oferta3Id)' onMouseOver='java script:SetButtonState(this, Oferta3Id, true)' onMouseOut='java script:SetButtonState(this, Oferta3Id, false)' style='cursor:pointer' alt='' /></div> </div> <div id='offer_text'></div> </div> <br class="cleaner" /> <script type='text/javascript'> ChangePage(PusteId); </script>
I zaincludowany plik: sp_offer.php
var PusteText = "<?php include('includes/menu.php'); ?>"; var Oferta1Text = "<?php include('includes/oferta1.php'); ?>"; var Oferta2Text = "<?php include('includes/oferta2.php'); ?>"; var Oferta3Text = "<?php include('includes/oferta3.php'); ?>"; Buttons[Oferta1Id].src = "buttons/offer/oferta1.png"; Buttons[Oferta2Id].src = "buttons/offer/oferta2.png"; Buttons[Oferta3Id].src = "buttons/offer/oferta3.png"; ButtonsHi[Oferta1Id].src = "buttons/offer/oferta1_hi.png"; ButtonsHi[Oferta2Id].src = "buttons/offer/oferta2_hi.png"; ButtonsHi[Oferta3Id].src = "buttons/offer/oferta3_hi.png"; ButtonsSel[Oferta1Id].src = "buttons/offer/oferta1_sel.png"; ButtonsSel[Oferta2Id].src = "buttons/offer/oferta2_sel.png"; ButtonsSel[Oferta3Id].src = "buttons/offer/oferta3_sel.png";
I po wybraniu odpowiedniego Buttonu wyświetla sie albo oferta1.php z prawej strony, albo oferta2.php, albo oferta3.
I to wszystko działa.
Ale teraz chciałabym, aby po wybraniu przycisku oferta1 pod spodem pojawiało sie dodatkowe menu: oferta1a, oferta1b, oferta1c.
Chciałabym, aby było tak:
screen3
W jaki sposób stworzyć nowe podmenu? Bo mój sposób nie działa ;/
Pozdrawiam i proszę o pomoc!!
Aga