0

I am currently using a full-screen image slider called supersized on a site, which references the images and associated extras in a script tag like so:

<script type="text/javascript">
    jQuery(function($){
        $.supersized({

            // Functionality
            property_1   :   value,     
            property_2   :   value,     

            slides       :   [
            {image :'http://image1.jpg', title :'Name1', url :'1.html'},
            {image :'http://image2.jpg', title :'Name2', url :'2.html'},
            {image :'http://image3.jpg', title :'Name3', url :'3.html'},
            ],

            // Options             
            option_1     :   value,
            option_1     :   value
        });
    });
</script>

What would be very nice, is to be able to dynamically load a new array of images with their associated extras via ajax (jquery preferred, but vanilla js fine). Is this possible? If so, I've struggled to find any resources that explain how.

2
  • 1
    sure, just have your server-side script spit out an array of images in JSON format. jquery can trivially accept that and use it as any other javascript array. Commented Nov 9, 2012 at 20:49
  • I think I understand. I'm fine getting the API to generate the JSON, it's getting javascript to pull that data dynamically on an event. Commented Nov 9, 2012 at 21:03

1 Answer 1

1

It seem that you need to code such feature youself.

See what plugin author is writing in FAQ: http://www.buildinternet.com/project/supersized/faq.html#q-4

Can I load different sets of slides without reloading the page?
This is a feature I am looking to develop out in the future. If you're hurting for it in the meantime, you can hire me for custom work.

If you need just one set of slides loaded by AJAX you can code it like that:

jQuery(function($){
  $.ajax({
    url: "URL"
  }).done(function ( data ) {
    $.supersized({

        // Functionality
        property_1   :   value,     
        property_2   :   value,     

        slides       :  data.slides,

        // Options             
        option_1     :   value,
        option_1     :   value
    });
  });
});
Sign up to request clarification or add additional context in comments.

1 Comment

Interesting - I'll take a look at that option more closely. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.