Tip: Make Facebook Images Float

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

Step 1.- Go to any profile or page, where obviously there are several images.
Step 2.- Open the Web Developer tools (Ctrl + Shift + I), or from Menu> Developer> Web console (Ctrl + Shift + K).
Step 3.- In the console paste the following code and press Enter.

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);

That is all! If you did it correctly, you will instantly notice that the images will slide across the screen, to the rhythm of a 'dancing sway'.

For Google Chrome

Step 1.- Go to any profile or page where there are images.
Step 2.- In the address bar of the browser (the omnibox), paste the following code:

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);

Eye! before pressing Enter, you must manually type javascript: at the beginning as shown in the code, as Chrome will not accept it if you paste it directly.

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).
And here comes the trick, I would love you to share, like or +1 =)


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Actualidad Blog
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.