Skip to content

Commit 2251c1a

Browse files
committed
remove excess js from verticals
1 parent f8e46d9 commit 2251c1a

File tree

5 files changed

+70
-103
lines changed

5 files changed

+70
-103
lines changed

_layouts/vertical.html

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,75 @@ <h2 class="vert-section-title">Sound interesting?</h2>
8383

8484
{% include blog-related.html %}
8585

86-
{% include footer.html extrascripts=page.extrascripts %}
86+
{% include footer.html %}
87+
88+
<script>
89+
// Health - change header colour
90+
var healthHeaderContainer = $('.health .gbl-head');
91+
if (healthHeaderContainer.length > 0) {
92+
var healthPatient;
93+
var healthResearch;
94+
var healthInnovation;
95+
var healthContact;
96+
97+
var scrollPositions = function () {
98+
healthPatient = $('#patientcentricity');
99+
healthResearch = $('#smartresearch');
100+
healthInnovation = $('#bottomupinnovation');
101+
healthContact = $('#vertcontact');
102+
};
103+
104+
var headerBG = function () {
105+
var windowTop = $(window).scrollTop();
106+
if (windowTop > healthInnovation.offset().top - 100 || healthInnovation.offset().bottom) {
107+
healthHeaderContainer.css({'background-color':'#37bec0'});
108+
} else if (windowTop > healthResearch.offset().top - 100 || healthResearch.offset().bottom) {
109+
healthHeaderContainer.css({'background-color':'#9b5ca4'});
110+
} else if (windowTop > healthPatient.offset().top - 100 || healthPatient.offset().bottom) {
111+
healthHeaderContainer.css({'background-color':'#0ea2dc'});
112+
} else {
113+
healthHeaderContainer.css({'background-color':'#37bec0'});
114+
}
115+
};
116+
117+
$(window).resize(scrollPositions).scroll(headerBG);
118+
scrollPositions();
119+
headerBG();
120+
}
121+
122+
// Transport - change header colour
123+
var transportHeaderContainer = $('.transport .gbl-head');
124+
if (transportHeaderContainer.length > 0) {
125+
var transportRail;
126+
var transportTech;
127+
var transportFuture;
128+
var transportContact;
129+
130+
var scrollPositions = function () {
131+
transportRail = $('#railservice');
132+
transportTech = $('#transporttechnology');
133+
transportFuture = $('#imaginingthefuture');
134+
transportContact = $('#vertcontact');
135+
};
136+
137+
var headerBG = function () {
138+
var windowTop = $(window).scrollTop();
139+
if (windowTop > transportFuture.offset().top - 100 || transportFuture.offset().bottom) {
140+
transportHeaderContainer.css({'background-color':'#9b5ca4'});
141+
} else if (windowTop > transportTech.offset().top - 100 || transportTech.offset().bottom) {
142+
transportHeaderContainer.css({'background-color':'#a4ce4e'});
143+
} else if (windowTop > transportRail.offset().top - 100 || transportRail.offset().bottom) {
144+
transportHeaderContainer.css({'background-color':'#37bec0'});
145+
} else {
146+
transportHeaderContainer.css({'background-color':'#0ea2dc'});
147+
}
148+
};
149+
150+
$(window).resize(scrollPositions).scroll(headerBG);
151+
scrollPositions();
152+
headerBG();
153+
}
154+
</script>
155+
87156
</body>
88157
</html>

js/vertical.js

Lines changed: 0 additions & 96 deletions
This file was deleted.

vertical-health.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ categories: [health]
55
permalink: /health/
66
colour: aqua
77
extraclasses: health
8-
extrascripts:
9-
- link: "vertical.js"
108

119
## Hero Content
1210
hero-title: We care about Health

vertical-insurance.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ permalink: /insurance/
55
categories: [innovation, insurance]
66
colour: blue
77
extraclasses: insurance
8-
extrascripts:
9-
- link: "vertical.js"
108

119
## Hero Content
1210
hero-title: Insuring the future...

vertical-transport.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ categories: [transport]
66
group:
77
colour: blue
88
extraclasses: transport
9-
extrascripts:
10-
- link: "vertical.js"
119

1210
## Hero Content
1311
hero-title: Transforming transport

0 commit comments

Comments
 (0)