Git Product home page Git Product logo

Comments (3)

sachinchoolur avatar sachinchoolur commented on August 23, 2024 1

Hi,
I am busy with some other projects and don't have much time to work on this project..
for current use you can just modify lightSlider.js

line number 13

onSliderLoad: function ($el) {},

line number 246

settings.onSliderLoad.call(this, $el);
$('#lightSlider').lightSlider({
    onSliderLoad: function(el) {
        $(el).removeClass('cS-hidden');
    }     
});

from lightslider.

sachinchoolur avatar sachinchoolur commented on August 23, 2024

Hi,

For the demo website i am using the following method..
Add .cS-hidden class to the ul and remove it once the slider is fully loaded.
.cS-hidden class is included in the lightSlider.css but it is not documented..

.cS-hidden {
    height: 1px;
    opacity: 0;
    filter: alpha(opacity=0);
    overflow: hidden;
}
<ul id="lightSlider" class="cS-hidden">
    <li>Slide 1</li>
    <li>Slide 2</li>
    .....
</ul
$('#lightSlider').lightSlider({
    onSliderLoad: function() {
        $('#lightSlider').removeClass('cS-hidden');
    }     
});

from lightslider.

scazzy avatar scazzy commented on August 23, 2024

aah, so you knew all along ;)
Anyway. but that's jerky too.
Secondly, it would be better if you give 'this' object scope inside your callback functions, like onSliderLoad.

$('#lightSlider').lightSlider({
    onSliderLoad: function() {
        $(this).removeClass('cS-hidden');
    }     
});

why? because

  1. most users might use class (multiple sliders) $('.slider'), and jquery search dom for the elements everytime you do a $('...') search.
  2. providing this might give user access to current elements already being used inside the plugin.

#suggestion

from lightslider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.