4 Replies Latest reply on Apr 19, 2010 3:41 PM by Girafix

    Swapping COntents in Divs

    Girafix

      Hi

       

      I have buit a web page using CSS div. Om Div being the main content holder (the largest), a  smaller long column shap div to the side which is for some small text and five small dive below the main dive acting as menu buttons (these have only text). I also have a div in the top left hand which holds a logo. I have worked out how to get some of my munu button divs to change text content in the small column dive. This was done by using the behaviour  (swap text in container or something like that). I want to know, can I swap content between my main div, that is to have a some text, click on the button div and replace the text with a flash file. All my text is formated using CSS. I was able to do this with frames. Can anyone suggest how to do this? It is possible?

        • 1. Re: Swapping COntents in Divs
          markerline Level 4

          As far as I know you need to use Javascript to swap div content by "getElementById" method.  It's possible probably to do it other ways, maybe in Actionscript 3.0 (Flash).  Someone chime in to let me know if I'm right.  Javascript is compatible with CSS.

          • 2. Re: Swapping Contents in Divs
            Girafix Level 1

            HI

             

            Thanks for the info, I thought as such that it would need some special scripting, unfortunately that is out of my league, I have no real knowledge of Java, or HTML for that matter. Do you know if there exists a script somehere that I can find and insert it in. Thanks for your help.

            • 3. Re: Swapping Contents in Divs
              markerline Level 4

              There is a difference between "Java" and "Javascript".  The two are not really related although they sound like it because of the name.  Java is used to write applications, similar to other programming languages like C++ and C#.  Javascript is a way for you to control what happens to documents.  You can use Javascript to control HTML Dreamweaver documents as well as even control Illustrator and Photoshop documents, like making a loop for redundant iterations of something like making a bunch of boxes on a page in Illustrator just by calling one box and having Javascript cycle through the script to place the other n number of boxes on the page at whatever page position increment you choose.  I do not know much about Javascript either, I am currently learning, but you can get some nice tutorial books at your local bookstore that carries computer books.  What you are asking is one of the more basic Javascript functions and I'm sure you'll find it in a book or if you do your research, even online.  I must warn you, you can't simply have a script and not know how to copy the syntax correctly to match your specific project so you still need to follow a good tutorial and write the script in Dreamweaver's Code View.

              • 4. Re: Swapping COntents in Divs
                Girafix Level 1

                I see. Hmmm, I will need to do more research, I will try the net first and see what I find. Thanks for your valuable information.

                 

                -


                markerline <forums@adobe.com> wrote:

                 

                =============

                There is a difference between "Java" and "Javascript".  The two are not really related although they sound like it because of the name.  Java is used to write applications, similar to other programming languages like C++ and C#.  Javascript is a way for you to control what happens to documents.  You can use Javascript to control HTML Dreamweaver documents as well as even control Illustrator and Photoshop documents, like making a loop for redundant iterations of something like making a bunch of boxes on a page in Illustrator just by calling one box and having Javascript cycle through the script to place the other n number of boxes on the page at whatever page position increment you choose.  I do not know much about Javascript either, I am currently learning, but you can get some nice tutorial books at your local bookstore that carries computer books.  What you are asking is one of the more basic Javascript functions and I'm sure you'll find it in a book or if you do your research, even online.  I must warn you, you can't simply have a script and not know how to copy the syntax correctly to match your specific project so you still need to follow a good tutorial and write the script in Dreamweaver's Code View.