How do I add custom scripts to the header ?

Asked on November 5, 2015 in Customization.

I would like to slow down the speed of the fade transition on the slider in my site. I have tried adding:

(function(
var Swiper = function (container, params) {
if (!(this instanceof Swiper)) return new Swiper

(container, params);

var defaults = {
speed: 900})

But it does not work. Is it possible to give an example of the format of the snippet that should go there?

Thank you

Chantal Layers User
Reply
  • Possible Answers to Your Question:

  • 1 Answer(s)
    Answered on November 6, 2015.

    Hi there,

    This is explained in the Layers User Guide: https://docs.layerswp.com/setup-guide/#header-footer

    jQuery snippets need to be wrapped in the jQuery function. Example:

     
    jQuery(function($) {
     
    $your vars etc
    }(jQuery));
    

    Swiper.js API reference: http://www.idangero.us/swiper/api/
    For help structuring these params into a jQuery snippet, please see http://www.idangero.us/swiper/forum/

    Reply