Advertisement
Guest User

js button click

a guest
Apr 17th, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //page
  2.  
  3.         var domain          = "http://localhost/new/";;
  4.         var home            = "#home";
  5.         var activities      = "#activities";
  6.         var about           = "#about";
  7.         var information     = "#information";
  8.         var contact         = "#contact";
  9.  
  10.         var up          = document.getElementById("up");
  11.         var dn          = document.getElementById("dn");
  12.  
  13.                                     //home page
  14.  
  15.         up.onclick = function()
  16.         {
  17.             if(document.URL == domain + home || document.URL == domain) { }
  18.             else if(document.URL == domain + activities ) { window.location = domain + about; alert(); }
  19.             else if(document.URL == domain + about )      { window.location = domain + information; alert(); }
  20.             else if(document.URL == domain + information ) { window.location = domain + contact; alert(); }
  21.             else if(document.URL == domain + contact )    { window.location = domain + about; alert(); }                
  22.             else {}
  23.         }
  24.  
  25.         dn.onclick = function()
  26.         {
  27.             if(document.URL      == domain + home )       { window.location = domain + activities; alert(); }
  28.             else if(document.URL == domain + activities )     { window.location = domain + about; alert(); }
  29.             else if(document.URL == domain + about )      { window.location = domain + information; alert(); }              
  30.             else if(document.URL == domain + information ) { window.location = domain + contact;alert(); }
  31.             else if(document.URL == domain + contact ) { window.location = domain + contact; alert(); }
  32.             else {}            
  33.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement