JQUERY EXPERT
Budget: $10 – $30 AUD
Hi guys,
I need a jQuery expert to fix my code.
In details:
I have a pagination build with jQuery and the code for it is below:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
jQuery(".hpagination li").click(function () {
jQuery(".hpagination li").css({ 'border': 'solid black 1px', 'color': 'black' });
jQuery(this).css({ 'color': '#FF0084' }).css({ 'border': 'none' });
var pageNum = this.id.substring(5);
jQuery("#past_results_content").load("https://host.com/past_results_data.php?hpage=" + pageNum +"&token=" + token);
});
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
The code above is not working if I don't put it inside a timer like this:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
setInterval(function(){
jQuery(".hpagination li").click(function () {
jQuery(".hpagination li").css({ 'border': 'solid black 1px', 'color': 'black' });
jQuery(this).css({ 'color': '#FF0084' }).css({ 'border': 'none' });
var pageNum = this.id.substring(5);
jQuery("#past_results_content").load("https://host.com/past_results_data.php?hpage=" + pageNum +"&token=" + token);
});
}, 500);
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
So when is in a timer, the pagination works but is buggy. Clicking on the pagination buttons sometime change the page and sometime not.
Thats the issue that I need to be fixed.
Please bear in mind that you need to fix the jQuery code without accessing the site itself because I'm developing this on my local machine and is not a public host.
Thank you
I need a jQuery expert to fix my code.
In details:
I have a pagination build with jQuery and the code for it is below:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
jQuery(".hpagination li").click(function () {
jQuery(".hpagination li").css({ 'border': 'solid black 1px', 'color': 'black' });
jQuery(this).css({ 'color': '#FF0084' }).css({ 'border': 'none' });
var pageNum = this.id.substring(5);
jQuery("#past_results_content").load("https://host.com/past_results_data.php?hpage=" + pageNum +"&token=" + token);
});
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
The code above is not working if I don't put it inside a timer like this:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
setInterval(function(){
jQuery(".hpagination li").click(function () {
jQuery(".hpagination li").css({ 'border': 'solid black 1px', 'color': 'black' });
jQuery(this).css({ 'color': '#FF0084' }).css({ 'border': 'none' });
var pageNum = this.id.substring(5);
jQuery("#past_results_content").load("https://host.com/past_results_data.php?hpage=" + pageNum +"&token=" + token);
});
}, 500);
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
So when is in a timer, the pagination works but is buggy. Clicking on the pagination buttons sometime change the page and sometime not.
Thats the issue that I need to be fixed.
Please bear in mind that you need to fix the jQuery code without accessing the site itself because I'm developing this on my local machine and is not a public host.
Thank you