Jump to content

Jack McKalling

Members
  • Posts

    1,606
  • Joined

  • Last visited

Posts posted by Jack McKalling

  1. No, you got that wrong. Theres only need for ONE colorNavs() per document! Because the loop colours everything.What I meant, is that there should be one for every document that has that navigation. Example:Homepage.html >> colorNavs(1, 4)MyForums.html >> colorNavs(2, 4)Paintings.html >> colorNavs(3, 4)Galery.html >> colorNavs(4, 4)It looks like what you say, many lines in the footer, but that is not true :D It is only ONE per file :( Else there would be no need for a looping, would there :) In fact, the function has a plural name.Why I do NOT recommend your way:When she uses your code, she can only save her files with a special number as a name, which is not common and bad in use. Filenames should be named discribingly, unlike with numbers. My code is filename-independant anyway :)But I don't like this, being a bit annoyed, shall we be friends again? :)

  2. My sollution would work too, wouldn't it :)With what I wrote above, you should manually define the current page for every document, that should be coloured differently, but it does work so that only one of the navs is coloured differently.With Blue's code you have to write more to colour the currentpage nav, and for other pages you have to write it again, you only have to write

    colorNavs(1, 5)
    When there are five nav elements and the current is one, with my code.And you won't want to write this over and over again:
    document.getElementById('Menu_With_Links').getElementsByTagName('A')[currentPage].style.color='#000000'
  3. This looks awfull :(

      <div id="text_nav">     <ul>      <li><a href="/painting" id="painting">painting</a>         <ul>          <li><a href>stereovision</a>             <ul>              <li><a href>contact</a>                 <ul>                  <li><a href>home</a></li>                </ul>              </li>            </ul>          </li>        </ul>      </li>    </ul>  </div>
    You should do it like this inside your stylesheet:
    li { display:inline; padding:10px; }
    And then this:
      <div id="text_nav">     <ul>      <li><a href="/painting" id="painting">painting</a></li>      <li><a href>stereovision</a></li>      <li><a href>contact</a></li>      <li><a href>home</a></li>    </ul>  </div>
    --------Second, you might write a loop for the adjusting to the nav's, instead of writing everyone after one another :) This could be the total scriptfile:
    function colorNavs(CurrentPage,Total) {for (c=1; c<Total; c++){  var NavObject = document.getElementById(/Nav/ + c) if (c == CurrentPage) {  NavObject.style.color = "black" // The NavObject that represents the page_id } else {  NavObject.style.color = "blue" // All other NavObjects }}}
    Then, just before </body> at the html-document, insert this script:
    <script type="text/javascript">colorNavs(define page_id, the total number of nav elements you have)</script>
    Don't forget to edit the coloured.And all your navigation elements you want to color should have an ID specified, but ALL like id="Nav1". The number is 1 for the first nav, 2 for the second etc...So: when you have done all this, you should only have to edit the blue line above at every document with this navigation, to the number that page represents :)
  4. Nonsens, tables are not only for tabular data. How could you ever think that? :DTables are good for putting blocklevel data next to eachother :yes:It can be done with stylesheets, but then ALL can be done like that! Using a table for querying blocklevel data on a line, still is structuring your document, which does not have to be done by CSS, that is only its style :)But we could have an endless discusion here, so we should leave it as is :( You are right, I'm right :)

  5. Actually, I try to avoid using .getElementsByTagName() and .all while they both are not w3c standard, .all because div layers are even only supported by netscape or some.Ahwell, I don't care about them being not standard. If I have to use them, I do, else, I'll think of something more usable.

  6. Like that, indeed.The javascript I want to use is like this: java script:ChangeCol("MoviesCol","FunCol","center_column")And for the second area:java script:ChangeCol("FunCol","MoviesCol","left_column")I am not sure this was the correct script, as somebody else wrote it for me, and I may have forgotten it a bit.

  7. Example:I want p=window.createPopup() and below it p.document.src="", so I can load a document in it instead of writing it right in this one. This comes in handy when I plan to use it as a Tooltip (like the attribute title="") on hovering one element, or clicking a button (like to show some help info).It also comes in handy when I want to activate the curent window and terminate the popup at the same time, by clicking in the window or popup. This is not possible when I use window.open() or the modelessdialogbox / modaldialogbox.

  8. .data? :DThat is just another new thing for me...Could someone please phonecall Refsness so they add all this to the tutorial? :)My head burns with al those newbees and I am getting burned up by questions about them all :)(It is that I do like to get answered at the forums, but more like to read the answer at the tut so I and many other people can learn it advancedly :( )I can't find anything about these things at the Html DOM tut, why not?Why are childNodes[] not a W3C standard?

  9. This is possible, am I right?Not difficult at all, just place the Content cell and the gray thing in one table, the gray cell with height:100% and that table just as you want it to.I would be glad to code it for you, if you could just give me your current version :)

  10. No, not correct. Tables may be used with and by anything you like. And what you want with this table inside a table can and may be done in Xhtml, but different to what you learned at Html lessons.One cell can be filled in a container cell, but there is no such thing as one cell without a table to support it. So the cell that you want to fill inside somewhere, must be inside another table. You wrote in Html the sollution, and that would work. But in Xhtml, it must be defined as styles, which, inline, are not inherited. So every parent of the filling cell untill the cell it should be in must get a height specification to 100%.It does not matter if the containing cell is 100px or also 100% of its own parent.

  11. Else there can be no feedback, no input by the visitors, can there? :)It would only contain information and no communication. This was a good idea, so it should get a link inside the banner somehow, or a navigation next to the banner's location :)

  12. I think I am the most frequent visitor of W3schools.com, of hole my country :)
    How can you know?
    I do not know ofcourse. I visit the site every day, and more than ten minutes a page, more than ten pages a day or whatever. So I don't belong to the average visitor, that can be found at the About Page Views page.:)
  13. As for your first problem, you shoud give the containing cell a fixed height value, like this:<td height="100">  <table height="100%"  border="0" cellpadding="0" cellspacing="0">      <tr>        <td> </td>      </tr>  </table></td>

    Yes, But this is Html, and for Xhtml it is forbidden to use height="". But why do you have a table inside another table(cell)? If you are able to write advanced CSS, you might even not need tables at all :)Well, try this:
    <td style="height:123px">  <table style="height:100%">    <tr style="height:100%">      <td style="height:100%">something in here</td>    </tr>  </table></td>
    Because the style attribute is not inherited. Or use classes instead, while the styles are inside your CSS.
  14. What I actually want is advanced explaining at the tutorial :)You might explain it too, then i'll try to make it clear:I tried to use the childNodes thing. Tried, because it would not work :)If there is an parent element with both text and embeded child elements, and the text comes before the embeded element,

    the_parent_element.childNodes[0]
    Would not work because it is followed by text instead of being the first content of parent_elementI hope now I am clear :(
  15. This board translating won't be a problem, indeed invision provides language packs (and since w3schools.com's forums use invision), but the whole site, I doubt it.You can't even imagine how much files should be copied, into different languages, or howmany strings should be included in the page where script can look for the right language... I really don't think that could be done, it is up to the Refsnesses (I guess :) )Maybe two or three languages (such as Spanish and Russian), but not many :)

  16. You don't understand. If I had something like this:

    <div id="border"><span id="selection">Hello <b>World!</b></span></div>
    Now the span has both text and an element directly inside. This way,
    document.getElementById("border").childNodes[0].childNodes[0].innerHTML
    won't work anymore because the second childNodes[0] is not the first content, the text "Hello " is.
×
×
  • Create New...