Git Product home page Git Product logo

Comments (6)

cbopp-art avatar cbopp-art commented on May 19, 2024

Did you ensure that you call lightcase only after the whole DOM is loaded? Sounds like you have included all javascript sources within the head tag but the function call not beeing executed when document is ready and $('body') is undefined yet.
If so, just do the function call like this:

jQuery(document).ready(function ($) {
        $('a[data-rel^=lightcase]).lightcase();
});

or alternatively:

(function ($) {
    $(function ()  {
        $('a[data-rel^=lightcase]).lightcase();
    });
})(jQuery);

from lightcase.

jelewis8 avatar jelewis8 commented on May 19, 2024

I've called lightcase within the document ready function, I've also called it with (window).load, so it definitely is getting loaded after dom is loaded. And, like I said, all my other jquery functions work within that same document ready block. I've also isolated it so just lightcase is loading, and nothing.

This is the weirdest thing, b/c I have used lightcase on literally dozens of other projects without any issues.

I even tried going back to previous versions, but I get the same problem.

I'm using jquery 1.10.2.

from lightcase.

jelewis8 avatar jelewis8 commented on May 19, 2024

I figured it out. This is bizarre.

My lightcase stylesheet had an id on it, like this:
<link rel="stylesheet" id="lightcase-css" href="css/lightcase.css" type="text/css" media="all" />

Removing the id="lightcase-css" makes it work. Keeping the id on there causes the "$case is not defined" error.

What would cause this?

UPDATE: changing the id to something different does not cause the same problem. So, that specific ID is causing problems.

from lightcase.

cbopp-art avatar cbopp-art commented on May 19, 2024

I figured out that this line is producing the error.

This wildcard selector seems to be a bit too generic, obviously. It checks if the neccessary markup is already added or not and will not do the call lightcase.settings.markup(); e.g. in your case.
I will have a look at this and implement an alternative solution which would allow to add id attributes to the markup starting with the lightcase.settings.idPrefix.

Thanks for your feedback about this issue and let's keep the status open.

from lightcase.

jelewis8 avatar jelewis8 commented on May 19, 2024

Glad to have helped. I thought I was going crazy for a while.
Keep up the great work, this is a fantastic plugin.

from lightcase.

cbopp-art avatar cbopp-art commented on May 19, 2024

@jelewis8
Fixed and available with the new release v2.1.0

from lightcase.

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.