com web/php: Last time for the TOC - made it more browser compliant, IE and FF the previous version would have broke in: js/common.js
| From: | Paul Dragoonis | Date: | Thu, 30 Dec 2010 22:12:12 +0000 |
| Subject: | com web/php: Last time for the TOC - made it more browser compliant, IE and FF the previous version would have broke in: js/common.js | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-23704@lists.php.net to get a copy of this message | ||
Commit: 270196912996bdc7a885370be09ec9306c3640d3
Author: Paul Dragoonis <dragoonis@gmail.com> Thu, 30 Dec 2010 22:12:12 +0000
Parents: f6ddccd93112f256a7021b125bff7d90d0d6b534
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=270196912996bdc7a885370be09ec9306c3640d3
Log:
Last time for the TOC - made it more browser compliant, IE and FF the previous version would have
broke in
Changed paths:
M js/common.js
Diff:
diff --git a/js/common.js b/js/common.js
index 981710d..1c12b6f 100644
--- a/js/common.js
+++ b/js/common.js
@@ -101,8 +101,9 @@ $(document).ready(function() {
if (foundToc) {
jQuery.getScript("/js/jquery.scrollto.min.js", function(){
l.delegate("a.toc_item","click keypress", function(e) {
+ var scrollToElem = $(this).attr('href');
// You have to escape the '.' to '\\.' so that it
doesn't start doing CSS-like selectors when we refer to "lang.type.string" as an ID
- var scrollToElem = $(this).attr('href').replace(/\./g, '\\.');
+ scrollToElem = scrollToElem.substr(scrollToElem.indexOf('#')).replace(/\./g,
'\\.');
if($(scrollToElem).length) {
$.scrollTo(scrollToElem, 800);
}