Comments (8)
Hi @shikkaba
You can do it by yourself.
const moveTo = new MoveTo();
const trigger = document.getElementsByClassName('js-trigger')[0];
moveTo.registerTrigger(trigger, function(target){
trigger.blur();
if (target instanceof HTMLElement) {
target.focus();
}
});
Thank you.
from moveto.
Thank you for writing this, but I'm just saying that this would be a good thing to have in the script as well.
from moveto.
Hi @shikkaba
Thank you for your sugesstion but, I am not sure this is a task that the plugin should do. I dont want to make this plugin complicated. I want to keep it simple and lightweight.
Thank you.
from moveto.
@hsnaydd by "not making it complicated" you make it even more complicated for others people to use. The code above doesn't work for me.
const moveTo = new MoveTo()
const triggers = document.getElementsByClassName('js-trigger')
for (var i = 0; i < triggers.length; i++) {
moveTo.registerTrigger(triggers[i], function (target) {
triggers[i].blur()
if (target instanceof HTMLElement) {
target.focus()
}
})
}
Uncaught TypeError: Cannot read property 'blur' of undefined
Thank you.
from moveto.
Callback doesn't return an element in the loop. It return undefined
or 4 (I got 4 elements). It doesn't return actual element!
from moveto.
Hi @iamdubx
Can you show me an example on jsfiddle ?
from moveto.
@hsnaydd sure, here - https://jsfiddle.net/Ltstnk0s/
from moveto.
Hi @iamdubx
Check this;
https://jsfiddle.net/Ltstnk0s/1/
from moveto.
Related Issues (18)
- Links don’t update URL with #hash HOT 5
- Some minifications suggestions HOT 1
- Multiple moveTo triggers doesn't work HOT 1
- Second click moves page on Top HOT 1
- Scroll inner div HOT 1
- Not Working in Firefox HOT 2
- Doesn't use proper browser History HOT 1
- Update polyfill document HOT 1
- Top margin of the first section ignored when scroll to top HOT 7
- Incorrectly looking target HOT 6
- Lazy loading images
- Offset for fixed header HOT 1
- doesnt work in flex div HOT 3
- Can this package support server side ?
- SyntaxError: Unexpected token: punc ()) - version 1.5.2 HOT 1
- demo中的easeFunctions下的easeInQuad有点问题~我不知道是不是我写的有错 HOT 1
- Problem with request animation frame loop HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moveto.