Git Product home page Git Product logo

Comments (8)

dhg avatar dhg commented on June 22, 2024

Hey Scott -

Thanks for the note - I will definitely check this out and see if it's cross-device and cross-browser compatible. I will be testing that before the next release :)

from skeleton.

dhg avatar dhg commented on June 22, 2024

Hey Scott -

Just started doing some work on the next version of Skeleton and tried the above code out and it didn't work. I would love to get a pull request going for this (or at least fully functional code). Not a JS optimization expert, but would love to hear more about the advantages too.

Will leave this open for now, but am going to work to close down all the issues and make sure Skeleton is in tip top shape for it's next release :)

from skeleton.

jellysandwich avatar jellysandwich commented on June 22, 2024

Scott forgot to include one of the parameters in the delegate function. It should be:

$('body').delegate('ul.tabs > li > a', 'click', function(e) {

instead of

$('body').delegate('ul.tabs > li > a', function(e) {

That works for me. As to what the benefits are, I wouldn't know. :P

from skeleton.

scottrabin avatar scottrabin commented on June 22, 2024

I actually forked and initiated a pull request shortly after Dave noted the issue, so it's been fixed for a while. If you're curious about the benefits, this is a good starting point, and you can find references all over the place.

Though, on researching that link again, there's now a disclaimer that the functionality will be encompassed in the on method... so we'll see how this evolves alongside jQuery.

from skeleton.

dhg avatar dhg commented on June 22, 2024

Couldn't merge in cause the typo, but this is in the branch now :)

from skeleton.

scottrabin avatar scottrabin commented on June 22, 2024

Hey Dave -

Since the commit for this is so recent, I'd recommend switching to the .on syntax instead of .delegate. The jQuery docs state that the latter is being phased out, and Skeleton now includes jQuery-1.7.1 by default. It's a quick fix -

$('body').delegate('ul.tabs > li > a', 'click', function(e) {

to

$('body').on('click', 'ul.tabs > li > a', function(e) {

I can pull-request this after a quick test, if you'd like; but the two calls are functionally identical, according to jQuery.delegate docs, and it really is very cosmetically trivial. It's only for future-proofing when .delegate is properly deprecated.

from skeleton.

dhg avatar dhg commented on June 22, 2024

Hey man -

Go for that and get a pull request and I will merge it in :) Thanks so much!

from skeleton.

dhg avatar dhg commented on June 22, 2024

Merged new ".on" and jQuery 1.7.1

from skeleton.

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.