The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.

Create a free forum like this one.

Moving luffy sprite on the forum?

View previous topic View next topic Go down

In progress Moving luffy sprite on the forum?

Post by Swagbito on January 10th 2015, 6:21 am

I would like to know if it is possible to put a moving Luffy sprite right above the categories and forums? Want it to be small.


Posts : 176
Reputation : 4
Language : English & Japanese

Back to top Go down

In progress Re: Moving luffy sprite on the forum?

Post by Ange Tuteur on January 10th 2015, 11:49 pm

Hello @Swagbito,

Go to Administration Panel > Modules > JavaScript codes management > Create a new script

Title : Your choice
Placement : in the homepage
Paste the code below :
$(function() {
  var leftImage = '',
      rightImage = '',
      speed = 40,
  eliza = document.createElement('IMG'), pos = 'positive', node = document.getElementById('pun-visit');
  if (!node) return;
    if (pos === 'positive') { = getLeft() + 1 + '%';
      if (getLeft() >= 97) pos = 'negative', eliza.src = leftImage;
    } else if (pos === 'negative') { = getLeft() - 1 + '%';
      if (getLeft() <= 0) pos = 'positive', eliza.src = rightImage;
  function getLeft() { return Number(,'')) }

At the top are the following variables which you can edit.

leftImage : the image to display when the element is moving to the left

rightImage : the image to display when the element is moving to the right

speed : the speed at which the image moves

make sure that the url of your image is between quotes.

Ange Tuteur

Male Posts : 13023
Reputation : 2690
Language : EN10, FR5
Location : Pennsylvania

Back to top Go down

View previous topic View next topic Back to top

Permissions in this forum:
You cannot reply to topics in this forum