svn: /web/php/trunk/js/ common.js

[email protected] (Paul Dragoonis)
Newsgroups php.webmaster
Message-ID <[email protected]>
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);
                         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.