jonathanstark / fastactive Goto Github PK
View Code? Open in Web Editor NEWA javascript snippet that makes web apps feel more native.
License: MIT License
A javascript snippet that makes web apps feel more native.
License: MIT License
This is a great concept and thank you sharing your code.
I was hoping to use something like this on my jqueryui tabs. On a mobile device, there is an delay when you tap the tab before it applies the class "ui-state-active" so the tab looks slow to become active.
I tried FastActive, but the active class doesn't get removed when you have tabs that are collapsable like in this example http://jqueryui.com/tabs/#collapsible.
The first time I click a tab, the active class is applied. The next time I click the tab to collapse it, the active class is still applied. So in my case the tab would stay highlighted even when it shouldn't be.
Do you know of anyway for this to work with things that need to be toggled like the collapsable tabs?
Thanks for any help you can provide?
Hey there, I added support for adding to an element with a certain class name instead of just a tag name
changed if (targetTagNames.indexOf(e.target.tagName) > -1) {
to
if (targetTagNames.indexOf(e.target.className) > -1 || targetTagNames.indexOf(e.target.tagName) > -1) {
Just a quick little fix that may be useful to others, your script was very helpful!
I'm excited to use FastActive, as I think it's just the right way to handle the tap/delay issue: simply.
So far though when I try to implement it, the active
class gets added to an a
element, but it stays there pretty much for good. It will sometimes get removed on subsequent taps/touches, but it's random.
I expected the active
class to only remain while the link was being touched. Is that a correct assumption?
I've been testing this on my iPhone 4S/iOS7/Safari, Chrome.
Example: http://codepen.io/FStop/pen/cuokl
Full pen link for easier mobile access: http://codepen.io/FStop/full/cuokl
I've also tested in Codepen's "debug" mode, which takes it out of an iframe and makes it into a plain old web page, just in case that had anything to do with it. Doesn't make a difference.
Am I an idiot (separate question, really) and missing something simple in the setup?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.