Grow your CSS skills. Land your dream job.

IE not recognizing header tag

  • # March 25, 2011 at 1:51 am

    I’m having an issue where IE 8 (haven’t tested on any others) isn’t recognizing the header tag. I’m using the html5 shiv. It’s not showing up at all..

    I’m also using a css reset that has

    article, aside, details, figcaption, figure,
    footer, header, hgroup, menu, nav, section {
    display: block;
    }

    Anybody else have this problem?

    # March 25, 2011 at 2:01 am

    Have you validated your html?

    # March 25, 2011 at 2:13 am

    hahahahahaaha…….. i was inlcuding the header before body…

    ANYWAY,

    that said,

    This code works in Chrome, not Firefox or IE:

    $(document).ready(function() {
    $('article').click(function(e) {
    e.stopPropagation();
    var offset = $(this).offset().top - 70;
    $('body').animate({scrollTop: offset}, 'slow');
    });
    });

    Maybe I’m missing something really obvious, but don’t think so.

    Regretting using HTML5 right now :D

    # March 25, 2011 at 2:22 am

    You’re forgetting to close

    Try this:

    $(document).ready(function() {
    $('article').click(function(e) {
    var offset = $(this).offset().top - 70;
    $('body').animate({scrollTop: offset}, 'slow');
    e.stopPropagation();
    });
    });
    # March 25, 2011 at 2:32 am

    Yeah sorry the bottom of the code didn’t get pasted.

    Unfortunately, moving stopPropogation() didn’t handle it, nor does removing it altogether.

    Is this the most practical way of doing this?

    Here’s a live example: http://websitesthatmarket.com/dblog/site/

    No, that photo isn’t of me.

    Click anywhere in any article and you’ll see what it’s doing. Only works in Chrome.

    Thanks!!!!!!!!!!

    # March 25, 2011 at 4:04 am

    Got it.

    $('article').click(function(e) {
    var offset = $(this).offset().top - 70;
    $('html, body').animate({scrollTop: offset}, 'slow');
    e.stopPropagation();
    });

    Note: $(‘html, body’)

    # March 25, 2011 at 4:14 am

    Ahhhhh you’re beautiful, that did the trick :)

    Thanks!!!

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".