I have a website frontend integrated from WordPress using an HTML 5 Blank Child Theme. The site features a logo effect utilizing particle slider for screen sizes greater than 960px, and a flat logo image for screen sizes less than 960px. Everything works perfectly; however, when I resize between logos, the page needs to be manually refreshed (by pressing cmd+r) before the particle slider effect reappears. How can I fix this so that the effect automatically shows after resizing?
Below is the code snippet -
particle-slider.php
<?php /* Template Name: particle-slider */ ?>
<!-- particle-slider template -->
<div id="particle-slider">
<div class="slides">
<div class="slide" data-src="<?php echo home_url(); ?>/wp-content/uploads/2017/10/havoc_logohight.png"></div>
</div>
<canvas class="draw" style="width: 100%; height: 100%;"></canvas>
</div>
<script type="text/javascript">
var ps = new ParticleSlider({ 'width':'1400', 'height': '600' });
</script>
<div id="logo"> <img src="<?php echo home_url(); ?>/wp-content/uploads/2017/10/havoc_logo.png"> </div>
<!-- particle-slider template -->
style.css
/* RWD for logo */
@media screen and (max-width: 960px) {
#particle-slider {
display: none;
}
...
}
ps.js
// Particle Slider version goes here
...
// Code continues as shown in original text
...
;