Comments (6)
Hey Tiago,
This doesn't sound like a FancySelect issue, but I can spend a couple minutes helping you take a quick look. Can you send through your code for:
- Where you're setting the
selects
variable - Where you're initializing jquery-steps
from fancyselect.
Hi Paul,
The selects variable is being set on top of the js file, like so:
var selects = $("select[multiple!='multiple']");
selects.fancySelect();
And a bit bellow, jQuery steps:
$("#settings-wizard").steps({
headerTag: "h3",
bodyTag: "section",
enableAllSteps: true,
showFinishButtonAlways: true,
titleTemplate: '<span class="number">#index#</span> #title#',
labels: {
next: "Next <i class='entypo chevron-right'></i>",
previous: "<i class='entypo chevron-left'></i>",
finish: "Finish <i class='entypo check'></i>"
},
onStepChanged: function (event, currentIndex) { selects.trigger("replace"); },
});
Everything seems okay to me, but I've been staring at that for a few hours now so...
Thanks for helping!
from fancyselect.
Hm, I can't tell just from the code you posted, but my guess is that you're doing something ajaxy or dynamically adding steps? Anyhow, basically it seems like what's going on is that your initial selects
variable is only grabbing the selects from the first step for whatever reason (either they don't exist yet or don't match that selector.
Either way, triggering replace
won't initialize non-fancified selects, it'll just update the options of ones that have already been fancified. Basically you need to grab a new reference to the selects in the step that got loaded in your onStepChanged
and call .fancySelect
on those.
Hope that helps!
from fancyselect.
Hmmm that's odd, I'm not using AJAX or dynamically adding steps. Plus, the "fancy-select" class exists on all selects. They just don't work when I click them. I'm guessing it's the way jquery steps works then.
Many thanks for the detailed explanation, I'll see if I can come up with a solution :)
Cheers!
from fancyselect.
If it's something you can zip up, you can email it to me ([email protected]) and I'll take a quick peek after hours.
from fancyselect.
(This is an email I sent after checking out this fiddle, which Tiago sent through email. I've copied the message for posterity and whatnot)
I spent a few minutes checking this out, and to be honest I have no idea what’s going on off the top of my head. BUT here’s a workaround. Instead of:
var selects = $("select");
selects.fancySelect();
do this:
setTimeout(function() {
var selects = $("select");
selects.fancySelect();
}, 0);
So, basically the equivalent of an Underscore defer
. One guess is that jQ Steps might be doing something weird with events? You could try updating to the latest version of FancySelect (with namespaced events) and see if that fixes it, but other than that I don’t have any clue what’s going on without spending more time on it (which, unfortunately, I don’t have at the moment). Best of luck!
from fancyselect.
Related Issues (20)
- Touch devices: show styled trigger but use browser's default UI to select an option HOT 7
- Zepto compatibility
- Question regarding click event & chaining.
- What is the best way to have 2 different select styles? HOT 2
- FancySelect not showing up on Windows Phone devices
- Minimal styles
- Links in dropdown options HOT 1
- Select not opened in iphone HOT 4
- Width Of Select Box and Dropdown Box
- Update Readme.md HOT 1
- OptGroups not supported HOT 4
- Validation On Select Box HOT 11
- A way to select a value using jquery HOT 2
- close dropdown problem HOT 1
- Add Bower and NPM Support HOT 3
- IE11 scroll Issue
- Tabbing + keydown in Firefox v50 opens native & styled dropdown's
- Filter or Hide options
- select item doesn't change in multiple select boxes
- Easily style select elements in all major browsers? How so?
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 fancyselect.