Question

I am currently trying to set up a liquid slider so that it starts on a random slide each time. Does any body know of a variable setting to enable this or a hacky workaround?

Liquid slider can be found here (its a version of coda slider for responsive layouts): http://liquidslider.kevinbatdorf.com/

The page I am working with is here, the slider in question is on the second row in the red container: http://www.astwood.co.uk/

I am currently activating the slider with:

$(function() { 
  $('#references').liquidSlider({
    autoHeight: true,
    hashLinking: true
  });
});
Was it helpful?

Solution

There's an option, firstPanelToLoad which defaults to 1. You could generate a random number based on the amount of slides you have. If you have 4 slides, I think it would be something like:

firstPanelToLoad:(Math.floor(Math.random() * 4) + 1)

And send me an email if you get stuck. I'm the author of the Liquid Slider and don't mind helping out where I can.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top