Hi Kathy,
--"I would like to add three buttons to my site - One to simulate using the
shortcut key "ctrl +" (this key combination enlarges the entire browser
screen by percentages each time it is tapped), one to simulate hitting the
"ctrl -" (this key combination reduces the entire browser screen by
percentages each time it is tapped), and one that would return the screen to
"default" size (I am not sure what the keystroke combination is to
accomplish this)."
--
This is in itself not impossible, but be prepared for many, many problems
with reading the key value, especially from the Control keys, and especially
on a Mac. For the intricacies, see eg
http://www.quirksmode.org/js/keys.html .
But why would you? All browsers support [Ctrl][+] and [Ctrl][-] to zoom in
and out, and most support [Ctrl][0] (that's a zero) to zoom to the default
level.
--"Ideally, I would like to also be able to set this up so that a user's
choice is stored so that when they return to the site, there size choice is
still being used."
--
There are three parts to this:
1) retrieve the zoom level of the browser,
2) store this value as a cookie, and
3) set the zoom level from a cookie, if present.
This is doable with JavaScript, but again, be prepared or many browser
incompatibilities, especially on a Mac, and within the various Internet
Explorer versions. In fact, I'd consider this advanced programming.
As for 1), see eg
http://blog.sebastian-martens.de/2009/12/how-to-detect-the-browser-zoom-level-change-browser-zoo
As for 2) see http://www.w3schools.com/js/js_cookies.asp
As for 3), that's the difficult part, since most browsers so not allow the
page to set its own zoom level. There is somne zoom support in CSS3, but it
is very poorly supported as of yet. But you might want to check out
http://www.hotscripts.com/blog/javascript-zoom-scripts
web-design@yahoogroups.com is sponsored, owned, and founded by Technogypsie Designs (formerly Wandering Leaf Designs)
~etching your presence on the web
leafworks@yahoo.com
To unsubscribe or change your settings:
Please go to http://www.yahoogroups.com
- login, - choose group to modify, - change to unsubscribe,
web only, digest, or single post mode
By email: send a email from your email address receiving this
post to web-design-unsubscribe@yahoogroups.com
0 comments:
Post a Comment