Jump to content

DarkxPunk

Members
  • Posts

    465
  • Joined

  • Last visited

Everything posted by DarkxPunk

  1. Completely understand. Thank you very much! I also used this (instead of JS which you helped with) to load the navigation bars style, sadly the JS was not working in IE.
  2. Lol was having fun reading all this banter Here is what I did in the end window.onload = function start(){var ads = document.getElementById("ads");var page = document.getElementById("page");var cont = document.getElementById("content");var inv = document.getElementById("involved");var adv = document.getElementById("adv");var advE = document.getElementById("advE");var host = document.getElementById("host");var hostE = document.getElementById("hostE");var exp = document.getElementById("exp");var expE = document.getElementById("expE");/* Plus the code I want to run when the page loads */} Then put the external JS file in the header, no onLoad or anything within the HTML and all my JS functions are "functioning" fine even the code that does not load when the page does works when called fine. So... THANKS! For all the help with getting the global functions to work. Please feel free to banter and bicker to find a more "compact" way to implement this. Will defiantly keep watch
  3. Well well guess what. Does not work in ie any ideas?My solution, do it in PHP! Winning! Lol. Thanks for the help guys!
  4. Amazing worked like a charm. If you are able to maybe break it down and explain how it all works I would love you for it
  5. Understood but how does that fix the global veriable problems? Even if I put the nessisary functions in a window.onload the global variables load before the page does, right?
  6. I will admit it. I prob need someone to do the job for me. PHP is very new to me, most I have made it do is a basic email form following a tutorial. So thank you to anyone who helps me out. It will be a learning experience for me.So I need php to change the title inside the header based on the URL. I know search engines dont read it when you use js so I need to do it in php.Thanks for any help,Michael Snape
  7. How do I implement it? Want to see my js?
  8. I needed to put the js script link just before the body ends and call the onload function to get it to work. Works...Prob a better way?
  9. Removing the bold kinda improved it...not really.Will keep playing.
  10. Ah... Could that be it then... The vars are being called before the page rendered... Will investigate. Never thought of that (JS noob feels smarter every day)
  11. If I am not correct global veriables are defined as such: var ads = document.getElementById("ads");var page = document.getElementById("page");var cont = document.getElementById("content");var inv = document.getElementById("involved");var adv = document.getElementById("advertise");var host = document.getElementById("host");var exp = document.getElementById("experience"); Being outside a function, and in turn a function can grab these at any time. * why is it not working?
  12. Well you be surprised but these are both macs... Lol.I will try removing the bold attribute.
  13. Finally got it! Thanks for all the help. This better understanding of for loop will really help my future efforts. Thanks again!
  14. What am I doing wrong? var anchorlink = document.getElementById("nav").getElementsByTagName("a");var pathUrl = document.location;var home = document.getElementById("nHome");var about = document.getElementById("nAbout");for(i=0;i<anchorlink.length;i++){ if (anchorlink[i] = pathUrl ) { home.className = "current nav"; } if (anchorlink[i] = pathUrl ) { about.className = "current nav"; }}
  15. Can you Explain how to do a for loop for this? I read the tutorial for it and still can't understand...
  16. Thanks for the tip. Here those snap shots: Same browser, different results... No settings set on either.
  17. I should take a screenshot of one of my macs compared to anouther. Same browser, dramatically different results.
  18. Yeah did that and solved nada. Is it possible to define per browser? I know you can with ie...
  19. Will look into it For some reason parentNode is the HTML element. Don't know why...I will post a concept I had that does not work maybe you guys can figure it out: I added an id to the li.var path = document.location.pathname;var home = document.getElementById("nHome");var about = document.getElementById("nAbout"); if (path = "ORMT/home.php") { home.className = "current nav"; } else { if (path = "ORMT/about.php") { about.className = "current nav"; } } I have the function load on page load.For some reason it puts the current nav class names into both. I don't get why. I tested the path and it gives ORMT/index.php yet it seems to ignore it and put the class names current nav in the about anyway
  20. Hey everyone, So I understand the usages of pt, px, em, %, etc. Sadly though modern day browsers don't (appear) to care what you put. There must be a way to counter it. If you view my site http://testzone.zeitgeist-toronto.com/ORMT and view it on each browser it looks completely different. Even on a iPad or a iPhone. But the layout is not screwed up, its the text size. Now the website is not dynamically sized its a fixed width so why can't I have the site look the same? Let me know,Thanks.
  21. Okay page loads.I need the js to find the URLOnce it finds the URL I need it to find the nav link the correspondsNow I need it's focus to go outside that nav link to the li holding itOnce it identifies the li it needs to add the class currentJs script doneI can get the script all the way to identifying the nav link. But I can't get it to go to the wrapping li to add the class.Better?
  22. DarkxPunk

    overflow?

    Auto fits it to the screen size. You collapse the screen space the nav compensates.
  23. So a common activity when using .php is to break parts that repeat and have it in one file that is simply printed to all pages on load. So I am doing this with my navigation bar. My navigation bar has a cool little wrap that lets me put whatever text in and it will wrap it. Sadly to do this I need the li to have a class name and the a in the li. It looks like this: <li class="current"><a href="index.html">Home</a></li> .current {background:url(image1.png);}.current a {background:url(image2.png);} Now because I want this to just be printed I am not manually adding this class to each page, I need some sort of JS to detect the URL and apply the class. I have looked over many concepts, sadly my need for the li to have the class ruins it. Any ideas? Thanks!
  24. Thanks for the posts. Its solved now ( This face is for the stupidity of JS sometimes, why cant it get the damn value)
×
×
  • Create New...