Jump to content

Attach Jquery slider to refresh script


thaidomizil

Recommended Posts

Hello,

 

i'm using this piece of code to refresh my div every X seconds:

 

  <script>
$(document).ready(function() {
	 $("#container").load("stats.php");
   var refreshId = setInterval(function() {
      $("#container").load('stats.php');
   }, 9000);
   $.ajaxSetup({ cache: false });
});
</script>

 

This works great, only thing i want to add is a slider like this one: http://jqueryui.com/demos/slider/#steps

 

I want it to be able to set the interval on the refresh timer which is by default 9000 (ms?)

 

Is it possible to let the slider modify the value ? if so, how can i do that ?

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/251025-attach-jquery-slider-to-refresh-script/
Share on other sites

  • 2 weeks later...

Just throw a variable into the slider and in the interval?

 

 

var refreshId = setInterval(function() {

      $("#container").load('stats.php');

  },time);

 

(I didnt download the slider or anything, so bare with me..)

time = 800;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.