This api is bundled with every slider you load from cdn.slidevision.io and provides easy access for developer to interact with your SlideVision slider.
If the method sl8v_on_before_loading
is defined in the context of window
this method will be called
- before the SlideVision slider gets initialized
If the method sl8v_on_slider_ready
is defined in the context of window
this method will be called:
- after the SlideVision slider is initialized
- before the SlideVision slider shows up in the page
If you want to listen by your own you can do:
$(document).on('ready.formslider', '.slidevision-formslider', function(){
console.log('SlideVision slider is ready');
});
Or if you want to wait until the api is loaded complete:
$(document).on('api.ready.formslider', '.slidevision-formslider', function(){
console.log('SlideVision slider-api is ready');
});
There are two parameters that can control wich slide the user sees at the beginning:
sl8v-goto-index=[indexFromZero]
loads a certain slide by indexsl8v-goto-id=[slideId]
loads a certain slide by slideId
- Current version of the sl8v slider api.
-
The container the SlideVision slider is initialized on.
-
Most the time is
$('.slidevision-formslider')
.
- This method returns object of the slides with the index as key and the div as value.
You can iterate over the slides by doing the following:
$(sl8v.api.slides()).each(function(index, slide){
var slideId = $(slide).data('id');
console.log(slideId);
});
- This is a proxy method to the js-url api to access url parameters.
- This is a proxy method to the js-cookie api to get cookies.
- This is a proxy method to the js-cookie api to set cookies.
- Return the current slide index.
- Returns the amount of slides.
-
Triggeres transition to the next slide.
-
This action will maybe not executed if an input field of the current slide has an validation error for example.
- Triggeres transition to the previous slide.
-
Triggers transition to a certain slide on a zero based index.
-
This action will maybe not executed if an input field of the current slide has an validation error for example.
-
Triggers transition to a certain slide based on the slide id.
-
This action will maybe not executed if an input field of the current slide has an validation error for example.
- Returns a plugin loaded from the SlideVision slider or undefined if not loaded.
-
Returns all or a certain value of the lead data that gets submitted.
-
If you specify a
key
and key is not in the store thefallback
value will be returned. -
Expects a
Form-Submission Create
orForm-Submission Lead-Mailer
plugin to be configured with the slider.
-
This method makes it possible to store data in the lead submission data store.
-
The
triggerTrackEvent
indicates if thiskey
andvalue
should be triggered to the configured tracking backends (Google-Tag-Manager, Facebook etc.)
-
The event manager is a light weight but powerful event pub/sub implementation.
-
An event is created by triggering a string (eventName).
before.leaving.question
for example. The event in this case isbefore
,leaving
andquestion
are tags. -
So it is possible to listen for some of the events:
before
before.leaving
before.question
before.leaving.question
before.question.leaving
-
You can not! listen for tags. The following will not be triggered:
leaving
question
leaving.question
question.leaving
-
Registers an event listener.
-
The
name
parameter has the following semantic:name[.tag1.tag2.tag3]
Possible pre define event names in chronoloical order:
* `ready` # fired when slider is ready
* `resize` # fired when page is resized
* `first-interaction` # fired after first transition
* `leaving` # fired before going to the next slide, can stop transition
* `leaving.[currentRole]` # currentRole it the role of the slide, a plugin can listen only listen for `leaving.zipcode`
* `leaving.[currentRole].next` # same as above but only when direction forward
* `leaving.[currentRole].prev` # same as above but only when direction backward
* `before` # fired after leaving, when transition is allowed
* `before.[nextRole]` # role of the up comming slide
* `before.[nextRole].next` # same as above but only when direction forward
* `before.[nextRole].prev` # same as above but only when direction backward
* `after` # fired after the transition
* `after.[currentRole]` # role of the current slide
* `after.[currentRole].next` # same as above but only when direction forward
* `after.[currentRole].prev` # same as above but only when direction backward
-
Deregister an event listener.
-
The
name
parameter has the following semantic:name[.tag1.tag2.tag3]