Programming is a fascinating world where there are no limits, with creativity, free time and above all many cups of coffee, impressive things can be developed. An example of this is the possibility of achieving a fun floating effect with Facebook images, based on a code JavaScript, which will undoubtedly attract the attention of any user who sees it.
The idea of this is that being in your profile for example, you paste a code in the browser and immediately the photo of your profile, cover and the other images begin to float all over your screen ... it has no use whatsoever, but it will be very fun to show off your computer skills 😉
Do you dare to try it? It's easy, read on to see how to do it right.
Floating images effect on Facebook
For Mozilla Firefox
javascript: R = 0; x1 = .1; y1 = .05; x2 = .25; y2 = .24; x3 = 1.6; y3 = .24; x4 = 300; y4 = 200; x5 = 300; y5 = 200; DI = document.getElementsByTagName ("img"); DIL = DI.length; function A () {for (i = 0; i-DIL; i ++) {DIS = DI [i] .style; DIS.position = 'absolute'; DIS.left = (Math.sin (R * x1 + i * x2 + x3) * x4 + x5) + »px»; DIS.top = (Math.cos (R * y1 + i * y2 + y3) * y4 + y5) + »px»} R ++} setInterval ('A ()', 5); void (0);
For Google Chrome
javascript:R = 0; x1 = .1; y1 = .05; x2 = .25; y2 = .24; x3 = 1.6; y3 = .24; x4 = 300; y4 = 200; x5 = 300; y5 = 200; DI = document.getElementsByTagName ("img"); DIL = DI.length; function A () {for (i = 0; i-DIL; i ++) {DIS = DI [i] .style; DIS.position = 'absolute'; DIS.left = (Math.sin (R * x1 + i * x2 + x3) * x4 + x5) + »px»; DIS.top = (Math.cos (R * y1 + i * y2 + y3) * y4 + y5) + »px»} R ++} setInterval ('A ()', 5); void (0);
Isn't it clear? Watch the video 🙂
To take into account:
- This code is not malicious
- It won't damage your computer or hack your profile 😉
- If you understand math and JavaScript you can modify it.
- To return to normal, reload the page (F5).