2016-12-06 43 views
0

较新版本的我有一个插件一些麻烦,与旧版本的jQuery但与newers工作:/一些代码升级到jQuery的

它最初是从这个页面 http://tympanus.net/codrops/2011/06/09/grid-navigation-effects/

经过一番调试看来,这些线是有罪的:

var currentRows = '', nextRows = ''; 
       for(var i = 0; i < opts.rows; ++i) { 
        currentRows += '.tj_row_' + (config.currentRow + i) + ','; 

        (dir === 1) 
         ? nextRows += '.tj_row_' + (config.currentRow + opts.rows + i) + ',' 
         : nextRows += '.tj_row_' + (config.currentRow - 1 - i) + ','; 
       } 

在控制台中的错误是

jquery.min.js:4 Uncaught Error: Syntax error, unrecognized expression: .tj_row_1,.tj_row_2,.tj_row_3,(…)

如果我评论他们我没有在控制台中的错误,但插件无法正常工作。

这个代码行jQuery的1.6.1完美地工作,但不是在1.9.1

上这是怎么回事,如何解决这个问题,请任何想法?

谢谢!

回答