1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- function debugRow(y, height) {
- if(y === undefined) y = 0;
- if(height === undefined) height = 1;
- $('body').append('<div class="debugrow" style="top: '+y+'px; height: '+height+'px; background: blue; position: absolute; width: 100%; opacity: 0.5;"></div>');
- }
- $(function() {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(screen.width > 1024 && screen.height > 768 && window.devicePixelRatio > 1) {
- $('[data-hq]').each(function() {
- t = $(this);
- if(t.is('img')) {
- t.attr('src', t.data('hq'));
- } else {
- t.css('background-image', 'url(' + t.data('hq') + ')');
- }
- });
- }
-
- baseline = 28;
- $('figure').each(function(i, e) {
- figure = $(e);
- realTop = figure.offset().top;
-
- realBottom = realTop + figure.height() + parseFloat(figure.css('margin-bottom'));
-
- gap = baseline - ((realBottom - $('article.body').offset().top) % baseline);
- figure.css('margin-top', '+=' + Math.floor(gap/2.0) + 'px');
- figure.css('margin-bottom', '+=' + Math.floor(gap/2.0) + 'px');
- });
-
- });
|