
In the
digital information platform referred to many as the internet, interactivity is one of the main issues being tackled by the web developers and designers of the world. With this, JavaScript programming is becoming big in the field of web design for interactivity. But, CSS and XHTML could also be used so as to provide more than just interactivity. That is, to put in a little dash of accessibility and customizability to the pages of any internet site.
Yet, most web developers and designers use a combination of both so as to tap the maximum potentiality a good web developer or designer could get out of proper web design tactics and techniques. One thing commonly used by CSS designers and developers is creating alternate-styled sheets for various pages on any internet site. But, access to these alternate sheets could be done through the use of interactive tools embedded on the page of an internet site. Yes, of course, using JavaScript programming. With the script above, the internet surfers of the world, regardless of internet site browser, could choose the alternate sheet they prefer to gain access. So, follow the script and try to integrate it on your internet site. But, don't forget to create and thus, include alternate-styled sheets for it to work properly!
< - start of code - >
HTMLLinkElement.getAttribute("rel").indexOf("style") != -1
HTMLListElement.getAttribute("title")
HTMLLinkElement.getAttribute("rel").indexOf("alt") != -1
function setActiveStyleSheet(title) {
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
}
< - end of sample - >
The script above contains some XHTML codes as well to properly determine the internet site browser being used the proper alternate-styled sheets to access. Plus, it gives the page viewer the power not only to choose which
alternate sheet to access, but to change alternate styled sheets between each other at will! Pretty cool, ain't it?