Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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.

    #590636

    Hey 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,
    Ismael

    #590646

    Hi 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

    #591363

    Hey!

    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 Kashyap

    #591506

    Hello 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

    #592569

    Hey!

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.