문제

I need to dynamically add a div around items then run a second bit to make the item rotate.

So far I can add the div but the second part doesn't load like it needs to.

<div id="ContentFeed">
<div class="newsItem">Text</div>
<div class="newsItem">Text</div>
<div class="newsItem">Text</div>
<div class="newsItem">Text</div>
<div class="newsItem">Text</div>
</div>

<script>$('#ContentFeed .newsItem').wrapAll('<div id="slider" />');</script>


    <div id="ContentFeed">
     <div id="slider">
        <div class="newsItem">Text</div>
        <div class="newsItem">Text</div>
        <div class="newsItem">Text</div>
        <div class="newsItem">Text</div>
        <div class="newsItem">Text</div>
    </div>
   </div>

<script>
$(function(){
    $('#slider').bxSlider({
        auto: false,
        displaySlideQty: 6,
        moveSlideQty: 6,
        pagerType: short,
        pager: true
  });
});
</script>

Any idea how to get the second part to see the dynamically added div?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top