Aindriú
Aindriú

Reputation: 3730

Javascript Navigation selector

I have a nav selector on my site that works well but I want to now change the navigation for 5 destinations while keeping things the same for the other 2 cities

here is my working code :

 <!-- Hero nav section -->
    <div class="no-gutter">
          <ul id="nav">
            <li><a href="<%= Application["baseURL"].ToString() + Session["lang"] + "/"+country+"/"+cityName+"/"+cityName+"-tours"%>"
                         <%if(url.Contains(cityName + "-tours")){%>class="current"<%}%>><% if (cityName == "washington-dc") {%>Washington, D.C.<% } else {%><%= cityName.Replace('-', ' ')%><%; } %> tours</a></li>
            <li><a href="<%= Application["baseURL"].ToString() + Session["lang"] + "/"+country+"/"+cityName+"/private-tours"%>"
                         <%if(url.Contains("private")){%>class="current"<%} %>>private tours</a></li>
            <li><a href="<%= Application["baseURL"].ToString() + Session["lang"] + "/"+country+"/"+cityName+"/nextday-tours"%>" 
                         <%if(url.Contains("nextday")){%>class="current"<%}%>>next day tours</a></li>
            <li><a href="<%= Application["baseURL"].ToString() + Session["lang"] + "/"+country+"/"+cityName+"/sale-tours"%>" 
                         <%if(url.Contains("sale")){%>class="current"<%}%>>sale tours</a></li>
        </ul>
    </div>

How I can keep it for Paris and London and change whats displayed for 5 italian cities..

ask for more info please !

Upvotes: 1

Views: 109

Answers (1)

george8767
george8767

Reputation: 76

var sum = 0;
 
var arr = [ 1, 2, 3, 4, 5 ];

$.each( arr, function( index, value ){
    sum += value;
});
 
console.log( sum ); // 15

JQuery code to iterate over jQuery and non jQuery objects

Upvotes: 1

Related Questions