Saturday, November 2, 2013

sniff and set HTML element styles with jQuery

$(function () {
   var loop = function () {
      var style = $("#brain").attr('style');
         if (style == "display: none;") {
            $("#brain").attr('style', "display: block;");
         } else {
            $("#brain").attr('style', "display: none;");
      }
   };
   var interval = setInterval(loop, 2000);
});

No comments:

Post a Comment