Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 43 lines (37 sloc) 0.89 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
<!DOCTYPE HTML>
<html>
  <head>
   <script src="jquery.js"></script>
   <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  </head>
  <body>
<style>
.news{ display: none }
</style>
<button id="anterior">&laquo; Anterior</button>
<button id="proxima">Próxima &raquo;</button>
<div id="alvo"></div>

<script>
$('#alvo').load('news0.html', function(){
 $('.news:first').show()
})
var current_news = 0
$('#proxima').click(function(){
  $('.news:visible').slideUp()

  current_news++
  if(current_news == 3) current_news = 0
  $('#alvo').load('news'+current_news+'.html', function(){
    $('.news:first').slideDown()
  })
})
$('#proxima').click(function(){
  $('.news:visible').slideUp()

  current_news--
  if(current_news == 0) current_news = 2
  $('#alvo').load('news'+current_news+'.html', function(){
    $('.news:first').slideDown()
  })
})


</script>
  </body>
</html>
Something went wrong with that request. Please try again.