-
AuthorPosts
-
February 26, 2016 at 11:07 am #589649
Hi,
I want to use some events of the layer slider to add and remove classes on other elements.
But when I changes the text in the event callbacks text boxes this will not be saved.I also tried to use my own created script, like:
jQuery(document).ready(function($) { $('#layerslider_9').layerSlider({ cbAnimStart : function(data) { my event; } }); });
But this seems to launch 2 sliders.
February 29, 2016 at 10:53 am #590636Hey tsluijter!
Thank you for using Enfold.
I’m sorry but the callback options are disabled.Why do you need to remove class attributes?Update: The only callback that is working is the cbInit, the rest are not functioning. Maybe, I’m not testing it thoroughly. Please review the callback documentation here: http://support.kreaturamedia.com/docs/layersliderwp/documentation.html#layerslider-api
Regards,
IsmaelFebruary 29, 2016 at 11:23 am #590646Hi Ismael,
In the first slide our logo is displayed.
We want to hide our logo in the header of the page, while this slide is displayed.In cbAnimStart we can test on data[‘curLayerIndex’].
If it is value 1 the logo in the header can be hidden by adding a css class.
If it is value 2 the logo in the header can be displayed by removing the css class.Regards, Tinie
March 1, 2016 at 7:06 am #591363Hey!
You can try this on the demo site open console paste it hit enter key and then click the next slider or other options on the slider to see changes at the bottom of the console. $ sign will not work in wordpress to avoid conflict so please use jQuery.
jQuery(document).ready(function() { jQuery('#layerslider_1_1').layerSlider({ hoverPrevNext: false, cbInit: function(element) { jQuery('.c-api'); console.log('function cbInit() called'); }, cbStart: function(data) { jQuery('.c-api'); console.log('function cbStart() called'); }, cbStop: function(data) { jQuery('.c-api'); console.log('function cbStop() called'); }, cbPause: function(data) { jQuery('.c-api'); console.log('function cbPause() called (pauseOnHover)'); }, cbAnimStart: function(data) { jQuery('.c-api'); console.log('function cbAnimStart() called, current layer is: ' + data.curLayerIndex + ', next layer is: ' + data.nextLayerIndex + ''); }, cbAnimStop: function(data) { jQuery('.c-api'); console.log('function cbAnimStop() called'); }, cbPrev: function(data) { jQuery('.c-api'); console.log('function cbPrev() called'); }, cbNext: function(data) { jQuery('.c-api'); console.log('function cbNext() called'); } }); });
In the above code please adjust the class and ID names to suit your site.
Cheers!
Vinay KashyapMarch 1, 2016 at 1:25 pm #591506Hello Vinay,
I have tried your solution before, and also tried it again with your code.
But this seems to start the slider twice.Regards, Tinie
March 3, 2016 at 11:40 am #592569Hey!
Please check this link for working examples at the bottom of the page…
http://www.docs.purethemes.net/sukces/layerslider/documentation/documentation.html
Hope this helps :)
Regards,
Vinay Kashyap -
AuthorPosts
- You must be logged in to reply to this topic.