Skip to content

Commit 4d2b308

Browse files
committed
Fix header / footer jump when multiple ads
1 parent 2760fd1 commit 4d2b308

File tree

322 files changed

+3864
-3220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+3864
-3220
lines changed

cargo/Adding+TLD+support+to+the+Jetty+container.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@
3535
});
3636
</script>
3737
<script>
38+
// The way Google handles the element is that the height (with the ad) is fixed,
39+
// appearing and disappearing is handled by making the bottom or top style negative
3840
window.setInterval(function() {
41+
var paddingBottom = 0;
42+
var paddingTop = 0;
3943
var headerPosition = "fixed";
4044
var ins = document.getElementsByTagName("ins");
4145
for (i of ins) {
42-
if (i.className && i.className.indexOf("adsbygoogle") != -1 && i.style) {
43-
var paddingBottom = 0;
44-
var paddingTop = 0;
46+
if (
47+
i.className && i.className.indexOf("adsbygoogle") != -1 &&
48+
i.style && i.style.display == "block") {
4549
if (i.style.bottom) {
4650
var bottom = parseInt(i.style.bottom)
4751
if (!isNaN(bottom)) {
@@ -61,15 +65,13 @@
6165
paddingTop = space;
6266
}
6367
}
64-
65-
// The way Google handles the element is that the height (with the ad) is fixed,
66-
// appearing and disappearing is handled by making the bottom or top style negative
67-
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
68-
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
69-
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
70-
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7168
}
7269
}
70+
71+
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
72+
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
73+
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
74+
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7375
document.getElementById("cargo-header").style.position = headerPosition;
7476
}, 100);
7577
</script>

cargo/Adding+a+JMS+resource+to+Resin3x.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@
3535
});
3636
</script>
3737
<script>
38+
// The way Google handles the element is that the height (with the ad) is fixed,
39+
// appearing and disappearing is handled by making the bottom or top style negative
3840
window.setInterval(function() {
41+
var paddingBottom = 0;
42+
var paddingTop = 0;
3943
var headerPosition = "fixed";
4044
var ins = document.getElementsByTagName("ins");
4145
for (i of ins) {
42-
if (i.className && i.className.indexOf("adsbygoogle") != -1 && i.style) {
43-
var paddingBottom = 0;
44-
var paddingTop = 0;
46+
if (
47+
i.className && i.className.indexOf("adsbygoogle") != -1 &&
48+
i.style && i.style.display == "block") {
4549
if (i.style.bottom) {
4650
var bottom = parseInt(i.style.bottom)
4751
if (!isNaN(bottom)) {
@@ -61,15 +65,13 @@
6165
paddingTop = space;
6266
}
6367
}
64-
65-
// The way Google handles the element is that the height (with the ad) is fixed,
66-
// appearing and disappearing is handled by making the bottom or top style negative
67-
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
68-
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
69-
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
70-
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7168
}
7269
}
70+
71+
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
72+
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
73+
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
74+
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7375
document.getElementById("cargo-header").style.position = headerPosition;
7476
}, 100);
7577
</script>

cargo/Adding+a+Samples+Test.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@
3535
});
3636
</script>
3737
<script>
38+
// The way Google handles the element is that the height (with the ad) is fixed,
39+
// appearing and disappearing is handled by making the bottom or top style negative
3840
window.setInterval(function() {
41+
var paddingBottom = 0;
42+
var paddingTop = 0;
3943
var headerPosition = "fixed";
4044
var ins = document.getElementsByTagName("ins");
4145
for (i of ins) {
42-
if (i.className && i.className.indexOf("adsbygoogle") != -1 && i.style) {
43-
var paddingBottom = 0;
44-
var paddingTop = 0;
46+
if (
47+
i.className && i.className.indexOf("adsbygoogle") != -1 &&
48+
i.style && i.style.display == "block") {
4549
if (i.style.bottom) {
4650
var bottom = parseInt(i.style.bottom)
4751
if (!isNaN(bottom)) {
@@ -61,15 +65,13 @@
6165
paddingTop = space;
6266
}
6367
}
64-
65-
// The way Google handles the element is that the height (with the ad) is fixed,
66-
// appearing and disappearing is handled by making the bottom or top style negative
67-
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
68-
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
69-
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
70-
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7168
}
7269
}
70+
71+
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
72+
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
73+
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
74+
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7375
document.getElementById("cargo-header").style.position = headerPosition;
7476
}, 100);
7577
</script>

cargo/Adding+a+container.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@
3535
});
3636
</script>
3737
<script>
38+
// The way Google handles the element is that the height (with the ad) is fixed,
39+
// appearing and disappearing is handled by making the bottom or top style negative
3840
window.setInterval(function() {
41+
var paddingBottom = 0;
42+
var paddingTop = 0;
3943
var headerPosition = "fixed";
4044
var ins = document.getElementsByTagName("ins");
4145
for (i of ins) {
42-
if (i.className && i.className.indexOf("adsbygoogle") != -1 && i.style) {
43-
var paddingBottom = 0;
44-
var paddingTop = 0;
46+
if (
47+
i.className && i.className.indexOf("adsbygoogle") != -1 &&
48+
i.style && i.style.display == "block") {
4549
if (i.style.bottom) {
4650
var bottom = parseInt(i.style.bottom)
4751
if (!isNaN(bottom)) {
@@ -61,15 +65,13 @@
6165
paddingTop = space;
6266
}
6367
}
64-
65-
// The way Google handles the element is that the height (with the ad) is fixed,
66-
// appearing and disappearing is handled by making the bottom or top style negative
67-
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
68-
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
69-
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
70-
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7168
}
7269
}
70+
71+
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
72+
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
73+
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
74+
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7375
document.getElementById("cargo-header").style.position = headerPosition;
7476
}, 100);
7577
</script>

cargo/Announcing+Codehaus+Cargo+1.7.16.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@
3535
});
3636
</script>
3737
<script>
38+
// The way Google handles the element is that the height (with the ad) is fixed,
39+
// appearing and disappearing is handled by making the bottom or top style negative
3840
window.setInterval(function() {
41+
var paddingBottom = 0;
42+
var paddingTop = 0;
3943
var headerPosition = "fixed";
4044
var ins = document.getElementsByTagName("ins");
4145
for (i of ins) {
42-
if (i.className && i.className.indexOf("adsbygoogle") != -1 && i.style) {
43-
var paddingBottom = 0;
44-
var paddingTop = 0;
46+
if (
47+
i.className && i.className.indexOf("adsbygoogle") != -1 &&
48+
i.style && i.style.display == "block") {
4549
if (i.style.bottom) {
4650
var bottom = parseInt(i.style.bottom)
4751
if (!isNaN(bottom)) {
@@ -61,15 +65,13 @@
6165
paddingTop = space;
6266
}
6367
}
64-
65-
// The way Google handles the element is that the height (with the ad) is fixed,
66-
// appearing and disappearing is handled by making the bottom or top style negative
67-
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
68-
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
69-
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
70-
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7168
}
7269
}
70+
71+
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
72+
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
73+
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
74+
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7375
document.getElementById("cargo-header").style.position = headerPosition;
7476
}, 100);
7577
</script>

cargo/Another+jump+in+Codehaus+Cargo+s+history+version+1.8.0+is+here.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@
3535
});
3636
</script>
3737
<script>
38+
// The way Google handles the element is that the height (with the ad) is fixed,
39+
// appearing and disappearing is handled by making the bottom or top style negative
3840
window.setInterval(function() {
41+
var paddingBottom = 0;
42+
var paddingTop = 0;
3943
var headerPosition = "fixed";
4044
var ins = document.getElementsByTagName("ins");
4145
for (i of ins) {
42-
if (i.className && i.className.indexOf("adsbygoogle") != -1 && i.style) {
43-
var paddingBottom = 0;
44-
var paddingTop = 0;
46+
if (
47+
i.className && i.className.indexOf("adsbygoogle") != -1 &&
48+
i.style && i.style.display == "block") {
4549
if (i.style.bottom) {
4650
var bottom = parseInt(i.style.bottom)
4751
if (!isNaN(bottom)) {
@@ -61,15 +65,13 @@
6165
paddingTop = space;
6266
}
6367
}
64-
65-
// The way Google handles the element is that the height (with the ad) is fixed,
66-
// appearing and disappearing is handled by making the bottom or top style negative
67-
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
68-
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
69-
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
70-
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7168
}
7269
}
70+
71+
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
72+
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
73+
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
74+
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7375
document.getElementById("cargo-header").style.position = headerPosition;
7476
}, 100);
7577
</script>

cargo/Ant+Tasks+Reference+Guide.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@
3535
});
3636
</script>
3737
<script>
38+
// The way Google handles the element is that the height (with the ad) is fixed,
39+
// appearing and disappearing is handled by making the bottom or top style negative
3840
window.setInterval(function() {
41+
var paddingBottom = 0;
42+
var paddingTop = 0;
3943
var headerPosition = "fixed";
4044
var ins = document.getElementsByTagName("ins");
4145
for (i of ins) {
42-
if (i.className && i.className.indexOf("adsbygoogle") != -1 && i.style) {
43-
var paddingBottom = 0;
44-
var paddingTop = 0;
46+
if (
47+
i.className && i.className.indexOf("adsbygoogle") != -1 &&
48+
i.style && i.style.display == "block") {
4549
if (i.style.bottom) {
4650
var bottom = parseInt(i.style.bottom)
4751
if (!isNaN(bottom)) {
@@ -61,15 +65,13 @@
6165
paddingTop = space;
6266
}
6367
}
64-
65-
// The way Google handles the element is that the height (with the ad) is fixed,
66-
// appearing and disappearing is handled by making the bottom or top style negative
67-
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
68-
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
69-
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
70-
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7168
}
7269
}
70+
71+
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
72+
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
73+
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
74+
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7375
document.getElementById("cargo-header").style.position = headerPosition;
7476
}, 100);
7577
</script>

cargo/Ant+support.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@
3535
});
3636
</script>
3737
<script>
38+
// The way Google handles the element is that the height (with the ad) is fixed,
39+
// appearing and disappearing is handled by making the bottom or top style negative
3840
window.setInterval(function() {
41+
var paddingBottom = 0;
42+
var paddingTop = 0;
3943
var headerPosition = "fixed";
4044
var ins = document.getElementsByTagName("ins");
4145
for (i of ins) {
42-
if (i.className && i.className.indexOf("adsbygoogle") != -1 && i.style) {
43-
var paddingBottom = 0;
44-
var paddingTop = 0;
46+
if (
47+
i.className && i.className.indexOf("adsbygoogle") != -1 &&
48+
i.style && i.style.display == "block") {
4549
if (i.style.bottom) {
4650
var bottom = parseInt(i.style.bottom)
4751
if (!isNaN(bottom)) {
@@ -61,15 +65,13 @@
6165
paddingTop = space;
6266
}
6367
}
64-
65-
// The way Google handles the element is that the height (with the ad) is fixed,
66-
// appearing and disappearing is handled by making the bottom or top style negative
67-
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
68-
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
69-
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
70-
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7168
}
7269
}
70+
71+
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
72+
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
73+
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
74+
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7375
document.getElementById("cargo-header").style.position = headerPosition;
7476
}, 100);
7577
</script>

cargo/Application+Classpath.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@
3535
});
3636
</script>
3737
<script>
38+
// The way Google handles the element is that the height (with the ad) is fixed,
39+
// appearing and disappearing is handled by making the bottom or top style negative
3840
window.setInterval(function() {
41+
var paddingBottom = 0;
42+
var paddingTop = 0;
3943
var headerPosition = "fixed";
4044
var ins = document.getElementsByTagName("ins");
4145
for (i of ins) {
42-
if (i.className && i.className.indexOf("adsbygoogle") != -1 && i.style) {
43-
var paddingBottom = 0;
44-
var paddingTop = 0;
46+
if (
47+
i.className && i.className.indexOf("adsbygoogle") != -1 &&
48+
i.style && i.style.display == "block") {
4549
if (i.style.bottom) {
4650
var bottom = parseInt(i.style.bottom)
4751
if (!isNaN(bottom)) {
@@ -61,15 +65,13 @@
6165
paddingTop = space;
6266
}
6367
}
64-
65-
// The way Google handles the element is that the height (with the ad) is fixed,
66-
// appearing and disappearing is handled by making the bottom or top style negative
67-
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
68-
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
69-
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
70-
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7168
}
7269
}
70+
71+
document.getElementById("cargo-navigation").style.paddingBottom = paddingBottom + "px";
72+
document.getElementById("cargo-content").style.paddingBottom = paddingBottom + "px";
73+
document.getElementById("cargo-header").style.paddingTop = paddingTop + "px";
74+
document.getElementById("cargo-header-spacing").style.height = (83 + paddingTop) + "px";
7375
document.getElementById("cargo-header").style.position = headerPosition;
7476
}, 100);
7577
</script>

0 commit comments

Comments
 (0)