Fixed slidr error (cannot find element with id 'slidr-div')

This commit is contained in:
Gregorio Chiko Putra 2017-09-16 13:27:14 +07:00
parent 81001825a3
commit f0713e9945

View File

@ -113,11 +113,13 @@
</main>
<script>
slidr.create('slidr-div', {
controls: false,
timing: {'linear': '0.5s ease-in'},
theme: '#666',
touch: true
}).add("h", [{% for post in posts %}"{{ post.id }}", {% endfor %} {% if posts|length > 1 %}"{{ posts.0.id }}"{% endif %}]).start().auto();
if (document.getElementById('slidr-div')) {
slidr.create('slidr-div', {
controls: false,
timing: {'linear': '0.5s ease-in'},
theme: '#666',
touch: true
}).add("h", [{% for post in posts %}"{{ post.id }}", {% endfor %} {% if posts|length > 1 %}"{{ posts.0.id }}"{% endif %}]).start().auto();
}
</script>
{% endblock %}