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

Loading images from database #50

Closed
CIRCLE73 opened this issue Jan 6, 2014 · 2 comments
Closed

Loading images from database #50

CIRCLE73 opened this issue Jan 6, 2014 · 2 comments

Comments

@CIRCLE73
Copy link

CIRCLE73 commented Jan 6, 2014

I´m using the plugin Jquery Vegas Slideshow in a project and I'm trying to load images directly from my database into the slideshow script.

I have it running with the following code:

<script type="text/javascript">
    jQuery.vegas('slideshow', {
        backgrounds:[
            { src:'images/slider/slider_01.jpg', fade:2500 },
            { src:'images/slider/slider_01.jpg', fade:2500 },
        ]
        })('overlay', {
        src:'images/slider/overlays/06.png'
    });
</script>

How can I populate the background parameter using Ajax?
I've read the documentation but there is no information about any server side language.

@jaysalvat
Copy link
Owner

Hello.

Simply load your background array by ajax and pass it to vegas.

$.get('url.json', function(data) {
    jQuery.vegas('slideshow', {
         backgrounds: data
         // ....
});

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

3 participants
@jaysalvat @CIRCLE73 and others