Comments (7)
Hey Vlad,
That is a very cool effect. I think you can achieve it as well without too much effort.
If you're not using autocomplete (Marco Polo), adding focusin
and focusout
event callbacks on div.mf_container
— after you've initialized Manifest on the input — makes it easy to add and remove the class:
$('#input').manifest('container')
.focusin(function () {
$(this).addClass('mf_focused');
})
.focusout(function () {
$(this).removeClass('mf_focused');
});
If you're using Marco Polo, however, the input blurs and gains focus again whenever a result is selected by mouse, which will likely cause an unwanted flicker effect. I do keep track of what I call "pseudo-focus" within the code, however, so it shouldn't be too difficult to provide hooks into those events. (I do already provide a onFocus
callback, but no onBlur
.)
Let me know what you think. Thanks!
Justin
from jquery-manifest.
Hey Justin,
Ah, I didn't notice the onFocus
callback. I am using Marco Polo, so I'm going to play around a bit to see if I can get around the flicker you mentioned.
Thanks again,
Vlad
from jquery-manifest.
Cool. Let me know how it works out. I'll close this for now, but feel free to continue replying here.
Justin
from jquery-manifest.
Hey Vlad,
I've added an onBlur
event callback in v1.5.0 of Marco Polo, which is bundled with the latest version of Manifest (v1.2.1). That may work better to hook into for what you're trying to do.
Justin
from jquery-manifest.
Justin,
Holy cow, how did I miss your comment??? I ended up playing around on my own, but taking a look at your changeset it looks much cleaner - I'm going to give it a shot and let you know how it goes. Thanks!!!
Vlad
from jquery-manifest.
Justin,
Thanks very much for the new version of Marco Polo - it worked like a charm. Looks like the focus/blur tracking is spot on, and the control I ended up creating (preview here: http://i.imgur.com/qKZX9.png) focuses naturally as if it were a regular text input field. Thanks again!
Vlad
from jquery-manifest.
Awesome! Looks great!
Justin
from jquery-manifest.
Related Issues (12)
- Resquet Values HOT 6
- Awesome plugin! HOT 3
- Is it possible to prevent duplicates? HOT 1
- A suggestion HOT 7
- onAdd ought to be able to overwrite user entered value HOT 7
- Calling values in an add or remove callback returns old values HOT 7
- onChange callback fired upon instantiation HOT 5
- Empty value HOT 2
- Values aren't added in IE 7 HOT 1
- Multiple separator characters HOT 3
- Have placeholder text in manifest bar HOT 7
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 jquery-manifest.