Forums
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Jquery SlideDown not working in chrome
I have a dropdown menu with a custom option that is suppose to make a textfield appear when chosen. The dropdown works in Safari but not Chrome. Any help? Below is a link to a codepen example.
[http://codepen.io/anon/pen/abmvg](http://codepen.io/anon/pen/abmvg “http://codepen.io/anon/pen/abmvg”)
Thank you
Works for me with a slight correction of the HTML:
I still don’t see it working in chrome, and as far as markup it passes w3validator. It works fine in Safari, it is just Chrome that is having issues.
Sorry, perhaps I misread the OP.
What have noticed is that if I remove
$(“.hiddenInput”).hide();
It works properly except that the span is visible.
You should use `change()` instead of `click()`
[http://codepen.io/georgearnall/pen/qyoEm](http://codepen.io/georgearnall/pen/qyoEm “http://codepen.io/georgearnall/pen/qyoEm”)
I was thinking that but my JQ knowledge is limited to being aware of `change`.
Pen updated. http://codepen.io/Paulie-D/pen/sgjBk
I also was thinking that this
if ($(“.customItemTogHidden”)[0].selectedIndex == 0)
is **way** to specific.
Couldn’t we do something based on the `value`rather than position in the stack.
such as this ? [http://codepen.io/georgearnall/pen/CAusD](http://codepen.io/georgearnall/pen/CAusD “http://codepen.io/georgearnall/pen/CAusD”)
Here ya go: http://codepen.io/ggilmore/pen/rEnJL
@georgearnall beat me to it!
@TheDoc I admit I had already experimented with that solution. When I noticed he was using click i abandoned it.
Neater guys….but now we have lost the SlideUp/Down
[http://codepen.io/georgearnall/pen/CAusD](http://codepen.io/georgearnall/pen/CAusD “http://codepen.io/georgearnall/pen/CAusD”)
Thank you guys for all your help. Not sure what was causing Chrome not to like the original method, but the other methods will work perfectly.
Almost….in the last Codepen there is no SlideUp.
It’s something to do with the span being hidden or not.