1

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 !

4
  • Um, maybe I'm just missing it because of your templating, but I don't see Paris or London anywhere. Consider creating a plnkr or jsfiddle to better demonstrate your problem. Commented May 14, 2015 at 19:12
  • So how do you want to change their display? Different text? Different links? Commented May 14, 2015 at 19:23
  • For italian cities I would like to display city names on the buttons of that page - while for the other two cities paris and london i would like to keep things as they are. so keeping things as they are for 2 cities while changing it for italian cities Commented May 14, 2015 at 19:26
  • can I change add a function to specific cities ? the nav was created using hero nav Commented May 15, 2015 at 7:25

1 Answer 1

1
+50
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

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.