Skip to content

Commit 64a0a4e

Browse files
moacirmodarenzon
authored andcommitted
moving js scripts to page bottom
1 parent 0fad70b commit 64a0a4e

File tree

3 files changed

+50
-56
lines changed

3 files changed

+50
-56
lines changed
Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,39 @@
11
// SMOOTH SCROLL
2-
$('a[href^="#"]').on('click', function(event) {
2+
$('a[href^="#"]').on('click', function (event) {
33
var target = $(this.getAttribute('href'));
44
if (target.length) {
55
event.preventDefault();
6-
$('html, body').stop().animate( {
6+
$('html, body').stop().animate({
77
scrollTop: target.offset().top - 100
88
}, 900);
99
}
1010
});
11+
12+
$(document).ready(function () {
13+
$('.owl-carousel').owlCarousel({
14+
autoPlay: 3000,
15+
loop: true,
16+
margin: 10,
17+
responsiveClass: true,
18+
dots: true,
19+
responsive: {
20+
0: {
21+
items: 1,
22+
nav: true
23+
},
24+
600: {
25+
items: 3,
26+
nav: false
27+
},
28+
1000: {
29+
items: 3,
30+
nav: true,
31+
}
32+
}
33+
})
34+
});
35+
36+
$('.popup-vimeo').magnificPopup({
37+
src: 'https://vimeo.com/398972182',
38+
type: 'iframe'
39+
});

pythonpro/core/templates/core/base.html

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,6 @@
1010

1111
<link rel="icon" type="image/png" href="{% static 'img/favicon.png' %}" />
1212

13-
{% block scripts %}
14-
<script type="application/javascript" src="{% static 'js/jquery-3.2.1.min.js' %}"></script>
15-
<script type="application/javascript" src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
16-
17-
<script src="{% static 'js/sentry.5.3.0.min.js' %}" crossorigin="anonymous"></script>
18-
<script type="application/javascript">
19-
Sentry.init({ dsn: '{{ SENTRY_DSN }}' });
20-
</script>
21-
22-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-44718512-1"></script>
23-
{# Google Tag Manager#}
24-
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
25-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
26-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
27-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
28-
})(window,document,'script','dataLayer','{{GOOGLE_TAG_MANAGER_ID}}');</script>
29-
{# End Google Tag Manager#}
30-
{% endblock %}
31-
3213
{% block styles %}
3314
<link rel="stylesheet" href="{% static 'css/custom.css' %}"/>
3415
<link rel="stylesheet" href="{% static 'css/default.css' %}"/>
@@ -156,6 +137,24 @@ <h3 class="mt-3">Entre em contato</h3>
156137
</footer>
157138
{% endblock footer %}
158139

140+
<script src="{% static 'js/sentry.5.3.0.min.js' %}" crossorigin="anonymous"></script>
141+
<script type="application/javascript">
142+
Sentry.init({ dsn: '{{ SENTRY_DSN }}' });
143+
</script>
144+
145+
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-44718512-1"></script>
146+
{# Google Tag Manager#}
147+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
148+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
149+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
150+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
151+
})(window,document,'script','dataLayer','{{GOOGLE_TAG_MANAGER_ID}}');</script>
152+
{# End Google Tag Manager#}
153+
154+
{% block scripts %}
155+
<script type="application/javascript" src="{% static 'js/jquery-3.2.1.min.js' %}"></script>
156+
<script type="application/javascript" src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
157+
{% endblock %}
159158

160159
</body>
161160
</html>

pythonpro/core/templates/core/lead_landing_page.html

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -43,45 +43,11 @@
4343
<meta property="og:image" content="{% static 'img/python-birds/card-python-de-graca.png' %}" />
4444
{% endblock %}
4545

46-
47-
{% block scripts %}{{ block.super }}
46+
{% block scripts %}
4847
<script src="{% static 'js/python-birds/jquery.min.js' %}"></script>
4948
<script src="{% static 'js/python-birds/owl.carousel.min.js' %}"></script>
5049
<script src="{% static 'js/python-birds/magnific-popup.min.js' %}"></script>
5150
<script src="{% static 'js/python-birds/main.js' %}"></script>
52-
53-
<script>
54-
$(document).ready(function(){
55-
$('.owl-carousel').owlCarousel({
56-
autoPlay: 3000,
57-
loop: true,
58-
margin: 10,
59-
responsiveClass: true,
60-
dots: true,
61-
responsive:{
62-
0:{
63-
items: 1,
64-
nav: true
65-
},
66-
600:{
67-
items: 3,
68-
nav: false
69-
},
70-
1000:{
71-
items: 3,
72-
nav: true,
73-
}
74-
}
75-
})
76-
});
77-
</script>
78-
79-
<script>
80-
$('.popup-vimeo').magnificPopup({
81-
src: 'https://vimeo.com/398972182',
82-
type: 'iframe'
83-
});
84-
</script>
8551
{% endblock %}
8652

8753
{% block body %}

0 commit comments

Comments
 (0)