Skip to content

Add box-shadow to jackColor in Switchery Plugin #166

@setarbgram

Description

@setarbgram

I have an iOS7 style switches for my checkboxes . but i need to show the handler with a box shadow.
how to add box shadow when it check,my code is like below

` var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));

        elems.forEach(function (html) {

            var switchery = new Switchery(html, {color: '#fff', jackColor: '#00aeef',jackSecondaryColor:''});

            html.onchange = function () {

                var medicineId = html.name;
                var checked = html.checked;
                var form = $('form').get(0);

                $.ajax({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    url: "{{\App\Helpers\serverName()}}/change-medicine-alarm?medicineId=" + medicineId + "&alarm=" + checked,
                    type: "post",
                    data: new FormData(form),
                    dataType: "json",
                    contentType: false,
                    cache: false,
                    processData: false
                }).done(function (res) {
                    var information = res;
                    console.log(information);
                    if (information=='ok'){

// var el = document.getElementsByClassName('js-switch');
//
// alert(el.closest("small"));
//
var s= $( "input#recipe" ).closest( ".switchery-default" ).find();
// .css( "left", "300px !important" );

                        console.log(s);
                    }

                });` 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions