having a button that switches between iframe and div

Discussion in 'HTML & Website Design' started by beermaker74, Feb 18, 2007.

  1. #1
    I have a page where I have a flash slide show embedded with swfobject.js in a div. I also have a iframe where I have a java applet that I need to show. I would like to have a button that switches between the two. ie when the page loads the flash shows and when I hit java button the flash div gets hidden and the iframe gets shown in the spot where the flash div was. Then if the user wants to show the flash slideshow again then they would just click on the flash buttin forthis. Hope I am explaining this right. IF it matters its all done on php pages.
    Thanks
     
    beermaker74, Feb 18, 2007 IP
  2. beermaker74

    beermaker74 Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Style Example</title>
    <script type="text/javascript">
    function toggle(sDivId) {
    var oDiv = document.getElementById(sDivId);
    oDiv.style.display = (oDiv.style.display == "none") ? "block" :
    "none";
    }
    </script>
    </head>
    <body>
    <div style=" cursor: pointer"
    onclick="toggle('divContent1')">Photo Slideshow Mode</div>
    <div 
    id="divContent1"><script type="text/javascript" src="http://www.myserver.com/vhtest/swfobject.js"></script>
                <div id="flashcontent">You need to upgrade your Flash Player </div>
                <script type="text/javascript">
    		// <![CDATA[
    		
    		var so = new SWFObject("http://www.imyserver.com/vhtest/listings.swf", "ssp", "500", "400", "7", "#cccc99");
    		so.addVariable("xmlfile", "http://www.myserver.com/vhtest/listxml/beermaker7414.xml"); // this line is optional, but this example uses the variable and displays this text inside the flash movie
    		so.write("flashcontent");
    		
    		// ]]>
    	        </script></div>
    <div style=" cursor: pointer"
    onclick="toggle('divContent2')">Virtual Tour Mode</div>
    <div style=" display : none"
    id="divContent2" ><iframe src="imageName.php" name="panoframe" style="width:550px; height:450px;"></iframe></div>
    </body>
    </html>
    HTML:
    i want to change it where the one div closes when you open the other one but it is sufficient for my purposes now
    I have a flash slideshow in one div them I have a dynamically written ptviewer panoramic tour in an iframe inside a div. Well if anybody has a quick fix to swap the divs so only one os open let me know
    thanks
     
    beermaker74, Feb 18, 2007 IP
  3. Aragorn

    Aragorn Peon

    Messages:
    1,491
    Likes Received:
    72
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Is this what you are looking for?
    http://www.weberdev.com/get_example-4572.html
    It is a Javascript Tab Control script. You can switch between different content at the same space.
     
    Aragorn, Feb 21, 2007 IP