jeudi 30 juin 2016

Active link turn different color

I'm trying to link those three scripts so that a active link turns to a different color purple. jquery.js contains the downloaded jquery library. I don't know why it is not working as expected. Anyone?

<link href="site.css" rel="stylesheet">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="color.js"></script>

</head>

<body>


<div class="nav-container" >
<ul class="navigation-menu" >
  <li><a href='start.php'>Home</a></li>
  <li><a href='pay.php'>C2B Payments</a> </li>
  <li><a href='sms.php'>C2B SMS</a></li>
  <li><a href='#'>B2C Payments</a>
    <ul>
      <li><a href="getbtc.php"> B2C Payments</a></li>
      <li><a href="payment.php"> Make Payments</a></li>
    </ul>
  </li>

  <li><a href='bsms.php'>B2C SMS</a></li>
  <li><a href='index.php'>Log Out</a></li>
</ul>

//JS color.js
$(document).ready(function(){
  $('ul li a').click(function(){
    $('li a').removeClass("active");
    $(this).addClass("active");
});
});

 //css site.css
.navigation-menu li a.active {
  background-color: purple;
  color:#fff;
  }

Aucun commentaire:

Enregistrer un commentaire