• Page 1 of 1
  • 1
Forum moderator: bigblog  
uCoz Community » For Webmasters » Custom Solutions » Creating a "Next"/"Previous" button for a pag.
Creating a "Next"/"Previous" button for a pag.
ZombieSlayer
Posts: 16
Reputation: 0

Message # 1 | 8:45 PM
I have a picture and video section on my site and I want to know how I can make a button for both those pages (e.g page 1 of 30 or "Next", etc.) that will allow whoever visits the site to go to a next page that contains either more pictures or videos and so on.

http://llamasarepeople.ucoz.com/
Good
Posts: 360
Reputation: 12

Message # 2 | 3:06 AM
You should install Video and Photo Album Module for videos and photos. Then, using below code for Next and Previous page.

Code

<div id="pages"></div>  
  <script>  
  a=location.href;  
  b=a.split('-');  
  c=b.length;  
  d=eval(c-1);  
  e=b[d];  
  f=a.split('-'+e)[0];  
  $('#pages').html('<a id="b" href="'+f+'-'+eval(e-1)+'"><img src="http://icons.iconarchive.com/icons/gakuseisean/ivista-2/96/Alarm-Arrow-Left-icon.png" border="0"></a><span id="i"> </span><a id="a" href="'+f+'-'+eval(e*1+1)+'"><img src="http://icons.iconarchive.com/icons/gakuseisean/ivista-2/96/Alarm-Arrow-Right-icon.png" border="0"></a>');  
  $.ajax({  
  type: 'GET',  
  url: f+'-'+eval(e*1+1),  
  error: function(){$('#a, #i').hide();}  
  });  
  $.ajax({  
  type: 'GET',  
  url: f+'-'+eval(e-1),  
  error: function(){$('#b, #i').hide();}  
  });  
</script>
ZombieSlayer
Posts: 16
Reputation: 0

Message # 3 | 3:30 AM
Thanks, but is there a way to make it work for only the sub categories?
Animorph
Posts: 2856
Reputation: 189

Message # 4 | 10:03 AM
ZombieSlayer, you could use conditional operators
To busy building a passive income online ;)
uCoz Community » For Webmasters » Custom Solutions » Creating a "Next"/"Previous" button for a pag.
  • Page 1 of 1
  • 1
Search: