Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Dreamweaver CS4 html code help. simple but im a beginner user?

Hi I am working on my first site and i have a code for html that switches text every x amount of seconds. This code does work but in designer view it takes away my "header" my "sidebar" My "main content" and just shows the rotating text html itself... I need help so that i can have that text rotate on the page and view main content also. Help is very appreciated thank you.

Update:

here is the code:

<html>

<head>

<title>Rotating Text</title>

<script type="text/javascript">

var rotatingTextElement;

var rotatingText = new Array();

var ctr = 0;

function initRotateText() {

rotatingTextElement = document.getElementById("textToChange");

rotatingText[0] = rotatingTextElement.innerHTML; // store the content that's already on the page

rotatingText[1] = "Ten Reason to Buy Gumballs";

rotatingText[2] = "White House bla bla";

setInterval(rotateText, 5000);

}

function rotateText() {

ctr++;

if(ctr >= rotatingText.length) {

ctr = 0;

}

rotatingTextElement.innerHTML = rotatingText[ctr];

}

window.onload = initRotateText;

</script>

</head>

<body>

<span id="textToChange">New Release... Leopard</span>

</body>

</html>

Update 2:

I see... that makes more sense now but if you create a new html in dreamweaver with a sidebar and header and footer which is fixed. then you paste my above code into the the sidebar code: <divid="sidebar1">

<h3>Sidebar1 Content</h3>

right before it says (endsidebar) then you switch from code view to design view your page only shows the rotating text and takes all my info on main content etc away. however when i go into firefox and test it. it shows everything normal and working. However this all creates a real problem for me adjusting any other info on the page when running this script... :/ headache! ha

2 Answers

Relevance
  • 10 years ago
    Favorite Answer

    I presume there is some non-rotating text that comes after the '<span id="textToChage">' section? I don't see any "header" or "sidebar" or "main content" that you mentioned.

    First thing you have to realize, Dreamweaver can NOT render javascript changing pages (among other things) correctly. What you need to do is open the file in a browser, and just leave it open. When you make a change in Dreamweaver, refresh the browser page to see your changes' effects.

    Dreamweaver is EXCELLENT for creating STATIC webpages. It is very good at creating dynamic webpages, inasmuch as you may need to create a static page for the dynamic process to put together. But it generally can not show you the dynamic parts itself.

    Otherwise, upon a cursory inspection of your code, I don't see anything wrong, other than you might want to specify a <!DOCTYPE> of some sorts. Browsers need to be told when you're using advanced features, otherwise they might just ignore all your nice fancy stuff.

    Source(s):   Sample doctypes: http://www.w3schools.com/tags/tag_doctype.asp
  • ?
    Lv 4
    4 years ago

    Dreamweaver layout mode is detrimental, no expert makes use of that element, and that i wouldn't in any respect hire a fashion designer who does. Dreamweaver code view is a posh text fabric editor, which does a marginally solid job of helping you write your guy or woman html. i could advise you learn the basics in Notepad first, for the reason which you could desire to be attentive to a thank you to do all of it via your self. Then, use the Dreamweaver code view or a distinctive helpful editor like notepad++ or vim. under no circumstances use Dreamweaver or FrontPage or word's save as web site. I found out html in highschool, took approximately 4 months, and became oftentimes on my own. remember via that this became overdue 90s whilst HTML4 and XHTML have been competing for dominance. I found out employing notepad.

Still have questions? Get your answers by asking now.