Say I have some JavaScript code in script tags like this:
"bubble": { "distance": 400, "size": 40, "duration": 2, "opacity": 8, "speed": 3
In another piece in script tags I count the day of the month.
If I want to say, if (day_of_week < 26):
then within bubble, change size to 50, how would I go about doing that?
Attached: whatthefuck.png (1198x659, 691K)
April 2, 2018 - 19:29
you can help a brotha out once in a while, maybe some day you'll be in need yourself.
April 2, 2018 - 19:31
And if that turns out to be the case he himself will turn to stackoverflow. Now go on and piss off.
April 2, 2018 - 19:33
it didn't work, wait let me
particlesJS('particles-js',
{ "particles": { "number": { "value": 80, "density": { "enable": true, "value_area": 800 }
April 2, 2018 - 19:34
so how would I write some code to change for examples the particle number to 90 or something, bear in mind the whole of particlesJS is within script tags.
April 2, 2018 - 19:35
stackoverflow is a designated shitting street
April 2, 2018 - 19:36
example:
a = { "particles": { "number": { "value": 80, "density": { "enable": true, "value_area": 800 } } } }
then:
a.particles.number.value = 90
April 2, 2018 - 19:41
and then call
particlesJS('particles-js', a)
April 2, 2018 - 19:43
what about when it's particlesJS( )
like that with a "dictionary" inside of it
April 2, 2018 - 19:44
that "woman" has many many masculine facial features
April 2, 2018 - 19:44
alternatively you can do this:
a = 90
particlesJS('particles-js', { "particles": { "number": { "value": a, "density": { "enable": true, "value_area": 800 } } } }
April 2, 2018 - 19:45
she does doesn't she? but for some reason I find her incredibly attractive.
I tried it but it didn't work, I don't really get what particlesJS is.
particlesJS('particles-js',
{ "particles": { "number": { "value": 80, "density": { "enable": true, "value_area": 800 } },
the above is within SCRIPT TAGS
April 2, 2018 - 19:47
>I tried it but it didn't work
open the javascript console.
what does it say?
April 2, 2018 - 19:53
here's what I did.
I set a = 90 initially, and that worked like a charm.
Then later in the exact same script, I set the condition, if day
April 2, 2018 - 19:56
Of course. OP is a faggot. You are the rule, not the exception.
April 2, 2018 - 20:06
Ok so, I found that changing the value of a after its been defined first at the top has no effect.
This would suggest that I have to change something inside particlesJS.
How do I do that? This is the part thats been confusing me all along
I have no idea WTF particlesJS actually is.
April 2, 2018 - 20:12
OP is why web developers have such a terrible name.
April 2, 2018 - 20:45
Read the documentation for particlejs.
April 2, 2018 - 20:48
NEW PROBLEM:
This should be easy, how to I get some text from another document to appear in javascript
say meme.html simply says "fuck you"
I want to call meme.html in my javascript and I want the exact contents of meme.html
April 2, 2018 - 20:54
I pm'd you the solution, have a nice day :)
April 2, 2018 - 20:56
Fuck that bitch, where's my Nancy?
April 2, 2018 - 21:03
most js plugins need to be reinit with new values. most likely those values are stored on init.
t. poo
April 2, 2018 - 21:05
You need to make an xmlhttprequest.
April 2, 2018 - 21:26
That's what work does to women you retard
April 2, 2018 - 21:49
And this isn't now fuck off
April 2, 2018 - 22:34
fetch('meme.html') .then(response => { //do something with the response body })
April 2, 2018 - 22:42