- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘Other’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
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?
Have you validated your html?
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
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();
});
});
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!!!!!!!!!!
Got it.
$('article').click(function(e) {
var offset = $(this).offset().top - 70;
$('html, body').animate({scrollTop: offset}, 'slow');
e.stopPropagation();
});
Note: $(‘html, body’)
Ahhhhh you’re beautiful, that did the trick :)
Thanks!!!