jquery - bootstrap ie8 modal popup -


i have googled this, , have tried few answers have found, can't resolve issue.

i have modal popup should appear on button press. works on other browsers / versions ie. 1 customer has use ie 8 (all still on xp, please no arguments should update. that's not going happen in near future.)

here bit of html code. (form details omitted brevity)

 <div class="modal fade" id="collect-email" data-backdrop="static" data-keyboard="false">     <div class="modal-header">         <a class="close" data-dismiss="modal">&times;</a>         <h3>collect customer email</h3>     </div>     <div class="modal-body"> 

....

i have html5shiv loaded. have js code below, should remove fade operation, , make modal work.

var ie = (function(){     var undef,         v = 3,         div = document.createelement('div'),         = div.getelementsbytagname('i');      while (         div.innerhtml = '<!--[if gt ie ' + (++v) + ']><i></i><![endif]-->',         all[0]     );     return v > 4 ? v : undef; }());  $(document).ready(function () {             if (ie < 10) {             jquery('.fade').removeclass('fade');     } ... 

however, page browsed, modal visible. , pressing close or ok buttons on modal popup not hide again.

update: swapped ie version detection code this, detects specific feature.

  if( ! document.addeventlistener  ){         alert("you got ie8 or less");          jquery('.fade').removeclass('fade');         $('#collect-email').modal({ show: false });     } 

the alert pops up, catching earlier browsers. fade removed, issue line; $('#collect-email').modal({ show: false }); added try , force modal disappear.

edit: found workaround. if manually hide , show div wrapping modal @ appropriate times, rest of code works. not elegant, xp / ie8, not goign lose sleep on now.

did remove fade class in markup? (check via inspect element). if not, maybe function not correct. have @ http://api.jquery.com/jquery.browser/ well


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -