CSS-Tricks / MovingBoxes

Simple horizontal slider which grows up the current box when it's in focus (image, title & text) and back down when it's not in focus.
http://css-tricks.github.io/MovingBoxes/
GNU Lesser General Public License v3.0
280 stars 147 forks source link

Duplicate content when adding new panel to slider #121

Closed YohannParisien closed 11 years ago

YohannParisien commented 11 years ago

When you're adding a new panel to slider with a code like this :


myPanel = '<div><img src="demo/*1.jpg" alt="picture" /><h2>News Heading #*2</h2><p>A very short exerpt goes here... <a href="#">more</a></p></div>',
slider = $('#slider-one'),
api = slider.data('movingBoxes'),

$('button.add').click(function(){
    imageNumber = api.totalPanels + 1;
    slider
        .append( myPanel )
            .movingBoxes();
});

The content of the first panel is merge with the content of variable myPanel in the new DIV panel only if your slider have the options fixedHeight set to true.

If the options fixedHeight set to false, everthing is OK, the new div is created with the content of myPanel variable.

Thanks,