1

tel-input plugin from Jack O'connor

https://github.com/Bluefieldscom/intl-tel-input

And I notice the flags take about a second to download, I want to smooth this with a fade in effect.

Can anyone suggest a way to do this?

steel
  • 11,010
  • 7
  • 63
  • 101
webmedia
  • 331
  • 1
  • 3
  • 8

1 Answers1

0

Turns out it's just a few extra lines of jQuery:

var selectedFlag = $(".intl-tel-input .selected-flag .flag");
selectedFlag.hide();
$('<img/>').attr('src', '/path/to/flags.png').load(function() {
   $(this).remove(); // prevent memory leaks
   selectedFlag.fadeIn(2000);
});

Demo here: http://codepen.io/jackocnr/pen/gLKtf

(Image caching technique from https://stackoverflow.com/a/5058336/217866)

Community
  • 1
  • 1
jackocnr
  • 16,344
  • 9
  • 52
  • 62