diff options
author | James Meyer <james.meyer@operamail.com> | 2010-11-04 18:06:25 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2010-11-04 18:06:27 (GMT) |
commit | 429f14eea9f4c00ddd8d82f25612213df8d4af84 (patch) | |
tree | d8441dd4ef5ef539c0b263b138d36fb1995c38d8 /build_tools/larch7/larch0/docs/html/css/yaml/core/js/webkit-focusfix.js | |
parent | 11ef4af01d6e197a54d0759e688ab5cbd336be4b (diff) | |
download | linhes_dev-429f14eea9f4c00ddd8d82f25612213df8d4af84.zip |
add profiles for larch 7
Diffstat (limited to 'build_tools/larch7/larch0/docs/html/css/yaml/core/js/webkit-focusfix.js')
-rw-r--r-- | build_tools/larch7/larch0/docs/html/css/yaml/core/js/webkit-focusfix.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/build_tools/larch7/larch0/docs/html/css/yaml/core/js/webkit-focusfix.js b/build_tools/larch7/larch0/docs/html/css/yaml/core/js/webkit-focusfix.js new file mode 100644 index 0000000..29e70d4 --- /dev/null +++ b/build_tools/larch7/larch0/docs/html/css/yaml/core/js/webkit-focusfix.js @@ -0,0 +1,40 @@ +/**
+ * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework
+ *
+ * (en) Workaround for Webkit browser to fix focus problems when using skiplinks
+ * (de) Workaround für Webkit-Browser, um den Focus zu korrigieren, bei Verwendung von Skiplinks
+ *
+ * @note inspired by Paul Ratcliffe's article
+ * http://www.communis.co.uk/blog/2009-06-02-skip-links-chrome-safari-and-added-wai-aria
+ *
+ * @copyright Copyright 2005-2009, Dirk Jesse
+ * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/),
+ * YAML-C (http://www.yaml.de/en/license/license-conditions.html)
+ * @link http://www.yaml.de
+ * @package yaml
+ * @version 3.2
+ * @revision $Revision: 430 $
+ * @lastmodified $Date: 2009-10-27 21:15:57 +0100 (Di, 27. Okt 2009) $
+ */
+
+var is_webkit = navigator.userAgent.toLowerCase().indexOf('webkit') > -1;
+
+if(is_webkit)
+{
+ var i;
+ var skiplinks = []
+
+ if ( document.getElementsByClassName !== undefined) {
+ skiplinks = document.getElementsByClassName('skip');
+
+ for (i=0; i<skiplinks.length; i++) {
+ var target = skiplinks[i].href.substr(skiplinks[i].href.indexOf('#')+1);
+ var targetElement = document.getElementById(target);
+
+ targetElement.href = '#'+target;
+ targetElement.setAttribute("tabindex", "0");
+
+ skiplinks[i].setAttribute("onclick", "document.getElementById('"+target+"').focus();");
+ }
+ }
+}
\ No newline at end of file |