[Resolved] Stop slider auto-advancing?
I’ve searched and Googled around for a while now, but I can’t seem to find the answer to what seemed to me a straightforward question: is it possible to set-up the Customizr slider to NOT auto-advance at all? (And if so, how? :P)
I would like to use the slider as a navigational element, and remain on the main image until the user decides to click on one of the navigational arrows.
Thanks a lot!
If you only use a single image slider, it might work?
Thank you, but unfortunately I do want my slider to have 3 (or more) images.
The current very early concept at http://www.studio-also.com/ should explain what I’m trying to achieve more clearly.
Upon arriving at the site, the initial slide image shows the two sections, and clicking on the forward or back arrows would switch the slide image to the appropriate section.
The concept works well, but the auto-advancing slider limits functionality and breaks the “illusion” of a user-decided navigation.
I’d basically like a slide delay of “forever”, or a “pause forever” rather than just on hover, but part of me expected there might be an easier solution–although I would not be surprised if it turned out to be either far more complicated or impossible.
The code can be found in /parts/class-content-slider.php but the delay is in js/tc-scripts.js.
As I’m not familiar with javaascript, someone else will hopefully pick up and resolve this for you.
I like your design btw!
@d4z, any chance we can write a snippet similar to this one from Nic?
@rdellconsulting, I tell you, my solution was rough. Since there’s not an option to avoid the auto-advancing I thought this:
– in tc-scripts.min.js, make a check on delay option length, and if is 1 (1 digit), then call the carousel setting
This way one can set the delay in sliders options to a number of 1 digit (but not 0, you can’t, there might be a check that prevents that), and that’s enough.
About write a snippet similar to that, don’t know, I’m not a js expert, I will figure out…
This seems to work. But I told you, I’m not a js expert, and don’t know if there might be a better way (anyway, as you can see, I copied much of nic snippet):
Since, if I’m not wrong, you use a static front page (id=4), then you don’t need that
$page_slidersarray, so that array will become:
$page_sliders = array( //page_id 4 );
Hope this helps.
@rdellconsulting Thanks for the reply and kind words, I’m trying to do something a little different with this flexible theme, and it’s always nice to hear someone else’s response to it–seems like I’m on the right track!
@d4z_c0nf Thank you for the suggestion, I’ll try it out the next time I have the chance! You were not wrong about the static front page, btw 😉
A more pragmatic solution would be to change the delay between slides in the Front Page panel of Customiz’it to 9999999999 (any more digits than that and the number wraps and it advances very quickly).
If nothing else, it’ll scare the hell out of someone who leaves your page open in their browser for 3 months, when the slide suddenly advances 🙂
I though about other 2 ways to do that.
One of them couldn’t be implemented without changing tc-scripts.js. Basically you can’t pass boolean false as delay param since wp_localize_script passes params as string, and it will be misinterpreted by boostrap.js.
The other one was override that param, simply printing a script in the footer (as wp_localize_script does) with
TCParams.SliderDelay = false
But.. is appropriate to say..
Everybody needs a pragmatic!
I am a big fan of pragmatism myself 🙂
While I’m messing around with every other aspect of the site, I’ll think I’ll stick with ElectricFeet’s easy-to-implement suggestion, which seems to work well. (Although the Customiz’it menu only appears to “show” 5 digits, it does seem to stay on the same slide for longer than the expected 16.66 minutes if that were true, so it appears to work well enough :P)
I think I’ll probably look into this some more at a later stage and see about a more “proper” solution, so thank you for the suggestions, d4z_c0nf!
Yep ElectricFeet’s solution is the better.
Don’t use mine, it’s not worthwhile 😀
- The topic ‘[Resolved] Stop slider auto-advancing?’ is closed to new replies.