IN my current
company, i got a task for UI. It was “the tab in navigation must
stay selected in color when we are landed on the same page.”
ex:- in my
navigation menu i have multiple tabs ('Home','About
us','Career','ContactUs'). When we are on “Career's” page the
carrer option on the navigation must be selected in colour, to
indicate the user that he is on the career's page.
It might be an easy,
for me also before working on this task but when i started work i
get's tough for me.
The issue was after
the selection any tab the page get refresh and it makes clean the
selection.
What i did is:
I gave an id for each tab's in Navigation-tamplate in Velocity.
example:
Then create a function and write the JS in my custom.js file with added a class name "activeMenu1".<div class="collapse navbar-collapse navbar-top-itl">
<ul class="nav navbar-nav navbar-right">
<li id='liCompany'>
<a href="$company_url" itemprop="sameAs" title="#language("company")" id="company-page-link">#language("company")</a>
</li>
<li id='liFeatures'>
<a href="$features_url" itemprop="url" title="#language("features")" id="features-page-link">#language("features")</a>
</li>
<li id='liUsecases'>
<a href="$use_cases_url" title="#language("use-cases")">#language("use-cases")</a>
</li>
<li id='liPricing'>
<a href="$pricing_url" title="#language("pricing")">#language("pricing")</a>
</li>
And define the colour for the Class which i define in js.function currentPage()
.activeMenu1border-top-color: white;
No comments:
Post a Comment