日期:2014-05-16  浏览次数:20534 次

jquery 中的each能够使用live吗?
默认载入会加上这些样式.等到后面AJAX动态刷新以后.下面这段就不起作用了.求怎么用live绑定下面这段啊?

$.each($(".{$this->prefix}allElder"),function(index,value){
                    var elder = $(this).next().next('.{$this->prefix}elder');
                    var maxWidth = $this->maxWidth;
                    var width = $this->width;

                    var vertical = $(this).children(".{$this->prefix}vertical");
                    //算出平均长度
                    length = Math.ceil((maxWidth)/(vertical.length-1)-1);
                    avage = Math.ceil($this->width/2);//竖线
                    $.each(vertical,function(index,value){
                        if( $(this).parent().next().next().children("div:eq("+index+")").html() == null)
                        {
                            side = $(this).parent().prev().prev().children("div:eq("+index+")");
                        } else {
                            side = $(this).parent().next().next().children("div:eq("+index+")");
                        }
                        if(index ==0 )
                        {
                        //竖线第一个
                            $(this).addClass('{$this->prefix}left');
                            $(this).css({'left':avage+'px','overflow':'hidden','position':'absolute'});
                            $(side).css({'left':index*length,