Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destroy and build method #5

Closed
flayks opened this issue Jul 19, 2012 · 4 comments
Closed

Destroy and build method #5

flayks opened this issue Jul 19, 2012 · 4 comments

Comments

@flayks
Copy link

flayks commented Jul 19, 2012

Another suggestion : for ajax calls and replacing content in the slider, why not add two methods? A destroy function to remove the slides and stop the slider, another one to rebuild it. It would be great.

@flayks
Copy link
Author

flayks commented Jul 20, 2012

Typical case :

I run a first time the slider with an ajax call. It works great and I have (2) slides and animations. I load another link with ajax and some other images (3). The slider seems to be totally broken because it create two nested "slides-control" divs.

<div id="bg" style="display: block; ">
    <div class="slides-control" style="position: relative; width: 4749px; height: 923px; left: -1992.2720908100137px; ">
        <div class="slides-control" style="position: relative; width: 4749px; height: 923px; left: -1583px; ">
            <ul class="bgimgs" style="display: block; ">
                <li style="display: block; position: absolute; overflow: hidden; top: 0px; left: 3166px; z-index: 0; width: 1583px; height: 923px; " class=""><img src="img/backgrounds/bg-waffle1.jpg" alt="" style="left: -8.5px; top: -288.5px; "></li>
                <li style="display: none; position: absolute; overflow: hidden; top: 0px; left: 1583px; z-index: 0; width: 1583px; height: 923px; " class=""><img src="img/backgrounds/bg-waffle2.jpg" alt="" style="left: -8.5px; top: -288.5px; "></li>
                <li style="display: block; position: absolute; overflow: hidden; top: 0px; left: 1583px; z-index: 2; width: 1583px; height: 923px; " class="current"><img src="img/backgrounds/bg-crepe1.jpg" alt="" style="left: -8.5px; top: -288.5px; "></li>
                <li style="display: none; position: absolute; overflow: hidden; top: 0px; left: 1583px; z-index: 0; width: 1583px; height: 923px; " class=""><img src="img/backgrounds/bg-crepe2.jpg" alt="" style="left: -8.5px; top: -288.5px; "></li>
                <li style="display: none; position: absolute; overflow: hidden; top: 0px; left: 1583px; z-index: 0; width: 1583px; height: 923px; " class=""><img src="img/backgrounds/bg-crepe3.jpg" alt="" style="left: -8.5px; top: -288.5px; "></li>
            </ul>
        </div>
    </div>
</div>

I have my first 2 slides and my next 3 slides loaded inside the first call of the slider. That's too bad...

Maybe it's is just to create a system to destroy the slider, load images again and rebuild the slider?

Or I forgot something, but if you have an idea...

PS: it would be very great :)

@nicinabox
Copy link
Owner

I'm going to add an update method in 0.4.1 that will allow Ajax functionality.

@nicinabox
Copy link
Owner

You can can now append slides through the API:

$('#slides').superslides('append', $jqueryObj)

@nicinabox
Copy link
Owner

Update: 0.5.0 will include a destroy method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants