Ajax 棒标题中的内容

Ajax content in stick titles

我对 https://github.com/desandro/sticky-titles 中的 ajax 内容有疑问 我确实通过 .load 函数重新初始化它仍然是新内容没有正确获取数据属性

    stickies=jQuery(".followMeBar");
            console.log(stickies);
    stickies.each(function(){
    console.log('in load each');
        var thisSticky = jQuery(this).wrap('<div class="followWrap" />');
            thisSticky.parent().height(thisSticky.outerHeight());

        jQuery.data(thisSticky[0], 'pos', thisSticky.offset().top);

    });

通过为固定头

创建一个单独的div解决了这个问题
    /*Code for fixed date row*/
                var flipVal;// offset value of current date on top
                var currentIndex=0;//index  value of current date on top
                var topOffsetValue=51;//(constant) offset value of fixed date from window top
                var  stickDateToTop = function(){
                    var elements=jQuery(".order-date");//get obj of all date row elements 
                            elements.each(function(index, value){
                                var thisObj = jQuery(value);
                                var divOffset = thisObj.offset().top;
                                currentElemnt=jQuery(elements[currentIndex]);
                                /* to Handle to date on scroll up */
                                if(currentElemnt.offset().top>flipVal){
                                    var backObj=jQuery(elements[currentIndex-1]);
                                    jQuery('#topDate').html(backObj.html());
                                }
                                /* to Handle to date on scroll down */
                                if(divOffset <topOffsetValue && divOffset>0){
                                    currentIndex=index;
                                    flipVal=divOffset;
                                    jQuery('#topDate').html(thisObj.html());
                                }
                            });
                }
                /*End of Code for fixed date row*/
<div id="topDate" class="order-date-main fixed">
            <!--fixed date here -->
        </div>