user1394792
user1394792

Reputation:

Issue with jQuery and IE

I just can't seem to figure out why my code is not working at all in IE. It works just fine in every other browser. Can anybody spot an issue?

$(document).ready(function (){
    var timerId = 0;
    $("#timerwrap").ready(function(){
        $("#timerwrap").html("Please wait <span style='font-weight: bold !important;' id='show-time'>4</span> seconds");
        console.log(timerId)

        if(timerId == 0){
            timerId = window.setInterval(function() {
            var timeCounter = $("#show-time").html();
            var updateTime = parseInt(timeCounter,10) - 1;
            $("#show-time").html(updateTime);

            if(updateTime <= 0){
               clearTimeout(timerId);

               $("#ltext").fadeOut('fast');
               $("#closeme").delay(600).fadeIn('fast');

            }
         }, 1000);
      }
   });

});


$(document).ready(function () {
   $("#closeme").click(function() {

      $("#rf").css("display", "none");
      $("#toppy").css("display", "none");
   });
});

$(document).ready(function () {
   $("#closelogo").click(function() {
      $("#rf").css("display", "none");
      $("#toppy").css("display", "none");
   });
});

Any help would be really appreciated, thanks.

Upvotes: 0

Views: 51

Answers (1)

Fraser
Fraser

Reputation: 14246

IE breaks with console.log. Remove console.log(timerId) and you should be fine

Upvotes: 1

Related Questions