View Full Version : Implementing JS script within forum? (Snow Effect)
Inked_Mono
12-08-2016, 09:56 PM
Hey, everyone! I'm just wondering what the best way to implement as JS script I have would be. The JS itself is currently being hosted off the FTP titled "snow.js", and I've tried sticking the following in many different places (footer and header included);
< script src="./snow.js" >< /script >
For whatever reason, I can't seem to get it to load. Also, something to sort of keep in mind is I have the following assigned as a div:
<div id="particles-js"></div>
and the following CSS:
#particles-js {
position: absolute;
width: 100%;
height: 780px;
left: 0;
top: 0;
opacity: 0.9;
}
The main page URL for the site is as follows, which currently contains the snow effect I'm trying to get on the forum;
https://www.os-scape.com/
Could anybody help?
MarkFL
12-08-2016, 10:17 PM
Try the following in your footer template:
Locate:
{vb:raw template_hook.footer_javascript}
And directly below, add:
< script type="text/javascript" src="snow.js" >< /script >
Personally, I would add this via a plugin so all styles get it, but go with that for now.
According to the developer console errors, it happens because it can't find a div with classname "particles-js-canvas-el". This might happen because of conflicting JavaScript files. For example vBulletin's JavaScript files may not work properly with the snow.js JavaScript.
Inked_Mono
12-09-2016, 01:37 AM
Try the following in your footer template:
Locate:
{vb:raw template_hook.footer_javascript}
And directly below, add:
< script type="text/javascript" src="snow.js" >< /script >
Personally, I would add this via a plugin so all styles get it, but go with that for now.
Hey Mark,
Ended up giving that a shot to no avail! I would totally consider making it a plugin, however that's a bit beyond me and not actually too necessary as we only use the same them (yeaaah, for now even for mobile version). Thank you though!
According to the developer console errors, it happens because it can't find a div with classname "particles-js-canvas-el". This might happen because of conflicting JavaScript files. For example vBulletin's JavaScript files may not work properly with the snow.js JavaScript.
Hey Dave,
I think you might be right! After trying Mark's idea above, I'm all out of options. I think I might play around with it for a bit longer and see if I can't figure something else out, or start a hunt for a predesigned snow plugin. Thank you!
MarkFL
12-09-2016, 01:44 AM
Yes, if you only have one active style, then the template hack is fine, although with a plugin, you can turn it on and off without touching your template.
If you want, send the login credentials to an admin account to your site via PM to me, and I will be glad to take a look and see if I can get it to work. :)
Inked_Mono
12-09-2016, 02:52 AM
Yes, if you only have one active style, then the template hack is fine, although with a plugin, you can turn it on and off without touching your template.
If you want, send the login credentials to an admin account to your site via PM to me, and I will be glad to take a look and see if I can get it to work. :)
Hey there, Mark!
I sent a PM containing as much information as I thought you may have needed. As mentioned within, if you need anything else please let me know and I'd be more than happy to provide it! Thanks!
the one
12-09-2016, 08:14 AM
i have this code below
<script type="text/javascript" src="clientscript/snowstorm.js"></script>
I added that to the bottom of my headinclude template and works for me.Hope you get it sorted.
MarkFL
12-09-2016, 08:50 AM
i have this code below
<script type="text/javascript" src="clientscript/snowstorm.js"></script>
I added that to the bottom of my headinclude template and works for me.Hope you get it sorted.
I found the JS file online, and uploaded it to the OP's server, and added the script via a plugin, and it works right out of the box with no additional HTML needed.
Inked_Mono, if you don't like this particular effect, simply delete the plugin titled "Add Snowstorm" and delete the file "clientscript/snowstorm.js" from your server. :)
Inked_Mono
12-09-2016, 06:05 PM
I found the JS file online, and uploaded it to the OP's server, and added the script via a plugin, and it works right out of the box with no additional HTML needed.
Inked_Mono, if you don't like this particular effect, simply delete the plugin titled "Add Snowstorm" and delete the file "clientscript/snowstorm.js" from your server. :)
Thank you so much for your help! I know it was quite the struggle. As mentioned in the PM, you need only let me know the answer to what I was offering.
Cheers!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.