// Avoid `console` errors in browsers that lack a console. (function() { var method; var noop = function() { }; var methods = [ 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn' ]; var length = methods.length; var console = (window.console = window.console || {}); while (length--) { method = methods[length]; // Only stub undefined methods. if (!console[method]) { console[method] = noop; } } }()); // Place any jQuery/helper plugins in here. $(function() { $(window).scroll(function() { if ($(document).scrollTop() > 0) { $('.header-container').addClass('small'); } else { $('.header-container').removeClass('small'); } if ($(document).scrollTop() > 100) { $('.scrollup').css({ left : $('header').width() + $('header').offset().left - $('.scrollup').width() }); $('.scrollup').addClass('visible'); } else { $('.scrollup').removeClass('visible'); } }); $(window).on('resize', function() { $(window).trigger('scroll'); }); var id = document.location.hash; if (id && id.indexOf("#") == 0 && $(id).length > 0) { $('html, body').animate({ scrollTop : $(id).offset().top - $('.header-container').height() - 50 }, 'fast'); } $('a').each(function() { $(this).click(function() { var id = $(this).attr("href"); if (id.indexOf("#") == 0 && $(id).length > 0) { $('html, body').animate({ scrollTop : $(id).offset().top - $('.header-container').height() - 50 }, 'fast'); document.location = id; return false; } }); }); $('.scrollup>a').click(function() { $("html, body").animate({ scrollTop : 0 }, 600); return false; }); $('.namespace').each(function() { var text = $.trim($(this).text()); if (text.indexOf(base) == 0) { text = text.replace(base, '' + prefix + ':' + '') + ''; $(this).html(text); } }); $('.th').each(function() { var prop = $.trim($(this).find('strong').text()); if (examples[prop]) { var a = $(this).parent('tr').nextUntil('tr[class!=s]').last(); var example = $('see an example +
' + examples[prop] + '
'); example.find('a').click(function(){ var div = $(this).next(); if(div.is(':visible')){ div.slideUp(); }else{ div.slideDown(); } return false; }); example.insertAfter(a); } }); });