svn: /web/php/trunk/js/ common.js
| From: | Paul Dragoonis | Date: | Thu, 30 Dec 2010 22:12:12 +0000 |
| Subject: | svn: /web/php/trunk/js/ common.js | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-10042@lists.php.net to get a copy of this message | ||
dragoonis Thu, 30 Dec 2010 22:12:12 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=306885
Log:
Last time for the TOC - made it more browser compliant, IE and FF the previous version would have
broke in
Changed paths:
U web/php/trunk/js/common.js
Modified: web/php/trunk/js/common.js
===================================================================
--- web/php/trunk/js/common.js 2010-12-30 22:11:51 UTC (rev 306884)
+++ web/php/trunk/js/common.js 2010-12-30 22:12:12 UTC (rev 306885)
@@ -101,8 +101,9 @@
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);
}