1

When user is visiting my webpage, bootstrap switch doesn't render properly at the first time, look:

enter image description here

Then, other times normal:

enter image description here

What I think is happening is that the page is rendering first than the Bootstrap Switch! Even using the Jquery ready function, as below:

$(function() {

    var btn_is_active = $("#btn-is-active");
    var btn_is_public = $("#btn-is-public");

    btn_is_active.bootstrapSwitch('state', {{ event.is_active|lower }});
    btn_is_public.bootstrapSwitch('state', {{ event.is_public|lower }});
});

I really want to avoid this kind of bad experience for the user, what should I do to fix it?

Lara
  • 2,170
  • 6
  • 22
  • 43
  • Can you give us a link towards your page or maybe an SSCE snippet ? – Eduard Mar 07 '16 at 18:04
  • Sure! http://191.252.59.101/dashboard/manage_event/ ... user ph@guia.com , pass: 123 Just copy and paste any Facebook Public Event into field and click on "Confirmar", you will see! – Lara Mar 07 '16 at 18:14

0 Answers0