PDA

View Full Version : Easy Fix



joshrodgers
08-16-2006, 06:29 AM
I don't code much but would like some help with a website problem. Basically I want to create a text magnification script on my website so people can enlarge/decrease text size. I found http://www.helical-library.net/coded/stylesheet_switcher.asp script. Basically it switches from one style sheet to another. So I made the fonts larger in one than the other. Worked fine. The only problem is I have a twenty page website and the script does a refresh to a specific page. If I am on Contact Us I don't want to go back to default if I click enlarge. Anyone have any suggestions? Thanks,

Josh

bootcom
08-16-2006, 09:55 PM
Sure. Why not reload the CSS without going anywhere ? I've done that on my sites before and it worked fine.

<script>

function changeSS(URL){
document.getElementById("styleSheet").setAttribute("href", URL)
// set a cookie here with the URL of the stylesheet.
// when the page loads use ASP to load in that URL
}

</script>

<link href="asp.asp" id="styleSheet" />

ASP ain't always the way to go :-)

Twey
08-16-2006, 11:16 PM
It's not necessary. IE and modern browsers are capable of resizing the default font through the browser interface.

joshrodgers
08-17-2006, 01:20 AM
Thank you both for your comments will test them both!

Josh