Jump to content

Webworldx

Members
  • Posts

    347
  • Joined

  • Last visited

Posts posted by Webworldx

  1. Mine's automatic, perhaps you should read the code more carefully. With yours, you'd end up with:colorNavs(1, 5)colorNavs(2, 5)colorNavs(3, 5)colorNavs(4, 5)in the footer, which cmuluna may aswell revert to her original switch code, as that's pretty much what you're doing with yours.By matching from the URL and storing the values in variables at the top of the page, and cycling through the list of objects in the DIV, it solves you needing to switch...

  2. var currentPage = 0if(location.href.match(/brilli\/(\d+).html/) != null){currentPage = Math.floor(RegExp.$1) - 1;}

    You'd basically put the above in the header of your document, then this in the footer:document.getElementById('Menu_With_Links').getElementsByTagName('A')[currentPage].style.color='#000000';So.. if you've got the bar:<div id="Menu_With_Links"> <a href="...">01</a> <a href="...">02</a> <a h....</div>Etc etc inside your menu, it'll just pick out your link without needing to ID each of them (although, you could do that if you wish). You could write a switch for the names, as this method wouldn't work with numbers, unless, for say painting, you had the url:brilli/0/01.htmland for stereovision, it was:brilli/1/01.html^^ notice how it works?If you need more help with this, reply back and i'll try and explain it a bit better!

  3. It look like on there that they've just literally done it per page.. so colored the "3" black when you're on page 3, etc.It really depends how you're writing your page. Will you be having a separate HTML page per number, or will it be done in PHP?If it's just HTML, you could do something like:var currentPage = 0if(location.href.match(/brilli\/(\d+).html/) != null){ currentPage = RegExp.$1}in Javascript, which would look for pages like brilli/01.html and brilli/45.html, and then color from there.

  4. I'll split it up a bit,

    Beginner - Learnt a bit of W3Schools, could modify a script if I really needed to.Intermediate - Can create my own scripts, know basic functions and what things don't work in other browsersAdvanced - Know a lot about the DOM, can create dynamic scripts and work with cookies and functions easily.Expert - Understand IE and FireFox propietary objects, and create complex cross-browser scripts.  Can use prototypes, and low level DOM functions like NodeFilters.
    Not an extensive list, but enough for you to vote on :)Just an interesting poll!
  5. Apart from the "niceities" of some IE-looking functions, you should be able to make your whole site cross-browser, without too much trouble. After all, that's why you're at w3schools and not IEschools right?:)

  6. Yes, but you'd have to use PHP then, or IFRAME the content if you don't have a PHP host. For instance.. umm:

    <table><tr><td> <iframe src="home.html" frameborder="no"></td></tr></table>

    Would be your index.html page.All your content would be loaded through the iframe in the main cell, so changing the content of your index.html page would change the look of most of your site (although, you'd have to make minor changes to the colors of the "home" and other pages etc).If you'd like an example of what i'm trying to get at: http://www.sc-photos.co.uk/other/exile . The text in the middle is an IFRAME, but the bits around it is all part of the index.htm file.PHP would be the ideal option, but iframes aren't too bad :)

  7. My knowledge of ASP is confined to VB/VBS unfortunately, so i'm a bit limited in helping you here, but while running through the script in my head:vFile_Destination = vMapLocal & "\" and then:fso.CopyFile vFile, vFile_DestinationWould you not want it to CopyFile to the mapped network drive, rather than the original source? (so Z:\ rather than \\servername\sharedfoldername)

  8. Say you've got:<table id="mytable"><tr><td>some text</td></tr></table>You can set the style of "mytable" through CSS using:#mytable { width: 100%; height: 100%; padding: 4px.. . etc etc }Upload the style sheet and use a <link rel= .. to put it on the page. Then you just need to change the styling in that one file to alter all instances of "mytable" on your site :)

  9. Think of it as if it didn't have eval around it at all - so if you've got:3 + 6 + youit's going to error, unless you have a variable called you. It's a useful thing for converting text to javascript statements, like:

    <script type='text/javascript'>var t = 8var i = eval("3+5+t");alert(i);</script>

    If you can understand that.

  10. userAgent is a nicer one, Opera declares itself through that. A combination of appName and userAgent should provide you with enough to browser sniff. It's always good to check whether the function you're trying to use is directly supported though - i.e:if( document.thisThing() ){}

×
×
  • Create New...