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.

auto refresh

View previous topic View next topic Go down

In progress auto refresh

Post by qmars(pkq) on June 19th 2014, 10:01 am

hello forumotion team
how can i have auto refresh in my home pege?
for example for each 20 sec

qmars(pkq)
Forumember

Posts : 219
Reputation : 1
Language : english,persian
Location : iran

http://lemon-13.full-forum.com

Back to top Go down

In progress Re: auto refresh

Post by SSYT on June 19th 2014, 10:59 am

Code:
jQuery().ready(function($){
  refresh_interval = 20000; // 20 sec
  setTimeout(function(){
  window.location.reload();
  console.log("refresh time is" + refresh_interval)
  }, refresh_interval);
});
try my code Smile

SSYT
Forumember

Male Posts : 37
Reputation : 2
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

In progress Re: auto refresh

Post by qmars(pkq) on June 19th 2014, 11:37 am

add this cod too where bro?

qmars(pkq)
Forumember

Posts : 219
Reputation : 1
Language : english,persian
Location : iran

http://lemon-13.full-forum.com

Back to top Go down

In progress Re: auto refresh

Post by SSYT on June 19th 2014, 4:08 pm

Sorry Smile
Go to: Administration Panel ~> Module ~> HTML & JAVASCRIPT ~> JavaScript code management.

SSYT
Forumember

Male Posts : 37
Reputation : 2
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

In progress Re: auto refresh

Post by qmars(pkq) on June 21st 2014, 11:05 am

it was working
but i want when i dont use the mouse or forum after the page be refresh
becuase when i chat in chat box it can refresh automaticaly and it make users angry

qmars(pkq)
Forumember

Posts : 219
Reputation : 1
Language : english,persian
Location : iran

http://lemon-13.full-forum.com

Back to top Go down

In progress Re: auto refresh

Post by SSYT on June 21st 2014, 6:42 pm

I do not understand what you mean.
You want a class / id to Forum Refresh?

SSYT
Forumember

Male Posts : 37
Reputation : 2
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

In progress Re: auto refresh

Post by qmars(pkq) on June 24th 2014, 1:19 pm

InFeRn0 wrote:I do not understand what you mean.
You want a class / id to Forum Refresh?
i mean i want auto refresh in my forum but when im not using forum and when im not in chat box or write topics

qmars(pkq)
Forumember

Posts : 219
Reputation : 1
Language : english,persian
Location : iran

http://lemon-13.full-forum.com

Back to top Go down

In progress Re: auto refresh

Post by Jophy on June 25th 2014, 10:23 am

Hello,

If you want the auto refresh not to work when you're moving around or typing, try this code:

Code:
$(function() {
  var idletime=0;
 
 setInterval(function() {
 idletime += 1;
  if (idletime > 20) {
  window.location.reload();
  }
  }, 1000);
 
 $(this).on('mousemove', function(e) {
 idletime=0;
 });
 
 $(this).on('keypress', function(e) {
 idletime=0;
  });
});

Now in this part:

Code:
if (idletime > 20)

20 means 20 seconds, if you want longer or shorter refresh intervals, you can increase or decrease that number.

Jophy
ForumGuru

Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

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