How to display page4 on one page if clicked 'next' - html

I have a page, if I click about on that page then I would like view page2 in other page.
In other page, there is consist 5 page. but if I click about, then page1 will displayed, not directly showing page2. please help
here my code:
<ul class="sf-menu">
<li class="current men">Adverb <strong class="hover"></strong></li>
<li class="men1"><a onClick="goToByScroll('page1'); return false;" href="#">Home</a><strong class="hover"></strong></li>
<li class=" men2"><a onClick="goToByScroll('page2'); return false;" href="#">About</a> <strong class="hover"></strong></li>
<li class=" men3"><a onClick="goToByScroll('page3'); return false;" href="#">Services</a> <strong class="hover"></strong></li>
<li class=" men4"><a onClick="goToByScroll('page4'); return false;" href="#">Contact</a> <strong class="hover"></strong></li>
<li class=" men5"><a onClick="goToByScroll('page5'); return false;" href="#">Login</a> <strong class="hover"></strong></li>
</ul>

Related

How to show top header when we click on navbar item?

I have one page with multiple section. When I click on menu item it goes to specific section but it hide header. All code for header is exist if we inspect page.
Code for Top menu is
<ul class="nav navbar-nav">
<li tabindex="0">Home</li>
<li tabindex="0"><a href="/en/#who-should-attend">Who should attend?
</a></li>
<li tabindex="0">Agenda</li>
<li tabindex="0">Facilitators</li>
<li tabindex="0">FAQ</li>
<li tabindex="0"><button type="button" id="LoginBtn" data-toggle="modal" data-whatever="#LoginModal" data-target="#LoginModal" class="btn btn-default" tabindex="0"><strong>Login</strong> </button></li>
<!--<li>About Us</li>-->
<li tabindex="0"> </li>
<li tabindex="0"><a target="_blank" href="https://www.hellmann.com/en/" rel="noopener noreferrer"> <box-icon type="solid" name="home"></box-icon> </a></li>
<li tabindex="0"><a target="_blank" href="https://www.linkedin.com/company/hellmann-worldwide-logistics/mycompany/verification/" rel="noopener noreferrer"> <box-icon type="logo" name="linkedin-square"></box-icon> </a></li>
</ul>
How can I solve this issue?

jquery dropdown without page refresh

i am using the bootstrap dropdown menu. and transitions between pages, I can provide my transitions without refreshing the page, but there is a situation where I get stuck, when the menu a href and submenu a hrefs are clicked, the dropdown remains open, I want it to be closed in an animated way. Finally, when "menu-item-has-children a" is clicked, "display: none" opens and when I click it again, it doesn't close. I couldn't understand why this was happening.
<div class="header__navigation">
<nav class="navbar-collapse collapse" id="cargopress-navbar-collapse" aria-expanded="true">
<ul class="main-navigation js-main-nav js-dropdown">
<li class="menu-item">
Home
</li>
<li class="menu-item menu-item-has-children">
<a class="sub-menu-a" href="#">
<span class="nav_item_wrap">Corporate</span>
<span class="nav_item_down"><i class="fa fa-angle-down"></i></span>
</a>
<ul role="menu" class="sub-menu" style="display: none;">
<li class="menu-item">
<a class="list-entry" href="http://localhost/en/corporate/about-us">ABOUT US</a>
</li>
</ul>
</li>
<li class="menu-item menu-item-has-children">
<a class="sub-menu-a" href="#">
<span class="nav_item_wrap">Services</span>
<span class="nav_item_down"><i class="fa fa-angle-down"></i></span>
</a>
<ul role="menu" class="sub-menu" style="display: none;">
<li class="menu-item">
<a class="list-entry" href="http://localhost/en/services/land-transportation">LAND TRANSPORTATION</a>
</li>
</ul>
</li>
<li class="menu-item menu-item-has-children">
<a class="sub-menu-a" href="#">
<span class="nav_item_wrap">İmportant İnformation</span>
<span class="nav_item_down"><i class="fa fa-angle-down"></i></span>
</a>
<ul role="menu" class="sub-menu" style="display: none;">
<li class="menu-item">
<a class="list-entry" href="http://localhost/en/important-informations/highway">HİGHWAY</a>
</li>
</ul>
</li>
<li class="menu-item">Contact Us</li>
</ul>
</nav>
</div>
$(".sub-menu").hide();
$('.menu-item-has-children a').click(function (event) {
event.preventDefault();
var elems = $(this).closest('li');
elems.siblings('li').find('ul').hide();
if (elems.find('.sub-menu').length) {
$(this).siblings('.sub-menu', elems).show();
}
});
$("li.menu-item").click(function () {
$('.navbar-collapse').removeClass('in');
});
$(".menu-item ul li a").click(function () {
$('.navbar-collapse').removeClass('in');
});
I think that is just a matter of using .toggle() instead of .show() to be able to close a sub-menu when it is already opened.
$(".sub-menu").hide();
$(".menu-item-has-children a").click(function (event) {
event.preventDefault();
var elems = $(this).closest("li");
elems.siblings("li").find("ul").hide();
if (elems.find(".sub-menu").length) {
$(this).siblings(".sub-menu", elems).toggle(); // .toggle() instead of .show() here...
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="header__navigation">
<nav class="navbar-collapse collapse" id="cargopress-navbar-collapse" aria-expanded="true">
<ul class="main-navigation js-main-nav js-dropdown">
<li class="menu-item">
Home
</li>
<li class="menu-item menu-item-has-children">
<a class="sub-menu-a" href="#">
<span class="nav_item_wrap">Corporate</span>
<span class="nav_item_down"><i class="fa fa-angle-down"></i></span>
</a>
<ul role="menu" class="sub-menu" style="display: none;">
<li class="menu-item">
<a class="list-entry" href="http://localhost/en/corporate/about-us">ABOUT US</a>
</li>
</ul>
</li>
<li class="menu-item menu-item-has-children">
<a class="sub-menu-a" href="#">
<span class="nav_item_wrap">Services</span>
<span class="nav_item_down"><i class="fa fa-angle-down"></i></span>
</a>
<ul role="menu" class="sub-menu" style="display: none;">
<li class="menu-item">
<a class="list-entry" href="http://localhost/en/services/land-transportation">LAND TRANSPORTATION</a>
</li>
</ul>
</li>
<li class="menu-item menu-item-has-children">
<a class="sub-menu-a" href="#">
<span class="nav_item_wrap">İmportant İnformation</span>
<span class="nav_item_down"><i class="fa fa-angle-down"></i></span>
</a>
<ul role="menu" class="sub-menu" style="display: none;">
<li class="menu-item">
<a class="list-entry" href="http://localhost/en/important-informations/highway">HİGHWAY</a>
</li>
</ul>
</li>
<li class="menu-item">Contact Us</li>
</ul>
</nav>
</div>
Edit based on comments.
my pages are running with xhr request
So I now assume that a click on a .list-entry link (link on the second menu level) triggers an xhr to update a part of the page... And that menu stays opened because it is not part of the page that changes.
So you would just need additionnal event handler. Something like:
$(".list-entry").click(function(){
$(".sub-menu").hide();
})

ARIA and pagination

I would like to get some advice on WAI-ARIA markup I have added to my paginated post navigation.
Does this look correct, am I missing anything?
Should anything be added/removed to the current page link (#2)?
Also, curious on my "Page Count" and "View All" sections what if anything can be added to make it more ARIA-friendly.
<nav role="navigation" class="post-navigation">
<ul role="menubar" class="pagination">
<!-- Page Count -->
<span class="page-count">Page 2 of 4 </span>
<li aria-label="Previous">
<a role="menuitem" aria-posinset="1" data-pagenum="1" href="#">
<span aria-hidden="true">«</span>
</a>
</li>
<li>
<a role="menuitem" aria-posinset="1" data-pagenum="1" href="">1</a>
</li>
<li class="active">
<span role="menuitem" aria-posinset="2">2</span>
</li>
<li>
<a role="menuitem" aria-posinset="3" data-pagenum="3" href="#">3</a>
</li>
<li>
<a role="menuitem" aria-posinset="4" data-pagenum="4" href="#">4</a>
</li>
<li aria-label="Next">
<a role="menuitem" aria-posinset="3" data-pagenum="3" href="#">
<span aria-hidden="true">»</span>
</a>
</li>
<!-- View All link handing -->
<li aria-label="View All">
<a role="menuitem" href="#?viewall">View All</a>
</li>
</ul>
</nav>

iPhone 6+ Mobile safari iOS 8 landscape with tabs open and Bootstrap navbar-fixed-top will not close when open

I have run into a bug with Bootstraps navbar-fixed-top with the iPhone 6+'s mobile safari in landscape on iOS 8. The bug only happens with other tabs open.
Here is how to replicate it:
1) Go to http://getbootstrap.com/examples/navbar-fixed-top/ on your iPhone 6+ in landscape – be sure you have one other tab open
2) Scroll down the page without opening the collapse
3) Once Safari's status bar (the url and tabs) goes away, open the navbar
4) Scroll back up so that Safari's status bar with tabs comes back up
5) Try to close the navbar.
I had this bug in iOS 7, but was able to fix it by adding the viewport minimal-ui meta. I have tested my iPhone 6+, and the 6+ iPhone simulator with the latest version of iOS 8. It appears the tabs are to blame since the regular iPhone 6 doesn't have this problem because the tabs do not show on the status bar. I would imagine this bug goes beyond just Bootstrap though, but applies to any fixed element on the top.
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" />
<div class="to-sticky navbar-fixed-top">
<div class="nav-container">
<div class="navbar">
<div class="navbar-header">
<a type="button" class="navbar-toggle btn-secondary btn" data-toggle="collapse" data-target=".navbar-ex1-collapse">
Main Menu
</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav" role="menubar">
<!--unless submenu-->
<li class="active nav-home first-li ">
Home
</li>
<li class="nav-dot nav-home">
<img src="http://assets-production-webvanta-com.s3-us-west-2.amazonaws.com/000000/51/21/original/images/dot.png" alt="" role="presentation">
</li>
<!--if submenu-->
<li class="dropdown ">
About<b class="caret"></b>
<ul class="dropdown-menu" role="menu">
<li class="">
Chair's Welcome
</li>
<li class="">
History
</li>
<li class="">
Campbell Hall
</li>
<li class="">
FAQs
</li>
<li class="">
Jobs & Fellowships
</li>
<li class="">
Integrity Statement
</li>
<li class="">
Contact
</li>
</ul>
</li>
<li class="nav-dot">
<img src="http://assets-production-webvanta-com.s3-us-west-2.amazonaws.com/000000/51/21/original/images/dot.png" alt="" role="presentation">
</li>
<!--if submenu-->
<li class="dropdown ">
People<b class="caret"></b>
<ul class="dropdown-menu" role="menu">
<li class="hidden-xs dropdown-submenu">
Faculty<b class="caret"></b>
</li>
<!-- if submenu. repeats previous code but this will show ONLY on MOBILE to expose third tier navigation -->
<li class="visible-xs dropdown-submenu">
Faculty<b class="caret"></b>
<ul class="dropdown-menu sub-menu" role="menu">
<li class=" ">Current
</li>
<li class=" ">Emeriti
</li>
</ul>
</li>
<li class="">
Researchers
</li>
<li class="">
Postdocs
</li>
<li class="">
Visiting Scholars
</li>
<li class="hidden-xs dropdown-submenu">
Graduate Students<b class="caret"></b>
</li>
<!-- if submenu. repeats previous code but this will show ONLY on MOBILE to expose third tier navigation -->
<li class="visible-xs dropdown-submenu">
Graduate Students<b class="caret"></b>
<ul class="dropdown-menu sub-menu" role="menu">
<li class="">Current
</li>
<li class="">Alumni
</li>
</ul>
</li>
<li class="">
Staff
</li>
</ul>
</li>
<li class="nav-dot">
<img src="http://assets-production-webvanta-com.s3-us-west-2.amazonaws.com/000000/51/21/original/images/dot.png" alt="" role="presentation">
</li>
<!--if submenu-->
<li class="dropdown ">
News & Events<b class="caret"></b>
<ul class="dropdown-menu" role="menu">
<li class="">
Department News
</li>
<li class="">
Department Events
</li>
<li class="">
Campus Calendar
</li>
<li class="">
Newsletters
</li>
</ul>
</li>
<li class="nav-dot">
<img src="http://assets-production-webvanta-com.s3-us-west-2.amazonaws.com/000000/51/21/original/images/dot.png" alt="" role="presentation">
</li>
<!--if submenu-->
<li class="dropdown ">
Academic Programs<b class="caret"></b>
<ul class="dropdown-menu" role="menu">
<li class="hidden-xs dropdown-submenu">
Undergraduate<b class="caret"></b>
</li>
<!-- if submenu. repeats previous code but this will show ONLY on MOBILE to expose third tier navigation -->
<li class="visible-xs dropdown-submenu">
Undergraduate<b class="caret"></b>
<ul class="dropdown-menu sub-menu" role="menu">
<li class="">Undergraduate Overview
</li>
<li class="">Requirements of the Astrophysics Major
</li>
<li class="">Declaring the Major
</li>
<li class="">How to Apply
</li>
<li class="">Undergraduate Resources
</li>
<li class="">Undergraduate Student Learning Initiative
</li>
<li class="">Policy on Academic Misconduct
</li>
</ul>
</li>
<li class="hidden-xs dropdown-submenu">
Graduate<b class="caret"></b>
</li>
<!-- if submenu. repeats previous code but this will show ONLY on MOBILE to expose third tier navigation -->
<li class="visible-xs dropdown-submenu">
Graduate<b class="caret"></b>
<ul class="dropdown-menu sub-menu" role="menu">
<li class="">Graduate Overview
</li>
<li class="">Degree Requirements
</li>
<li class="">How to Apply
</li>
<li class="">Graduate Resources
</li>
<li class="">Teaching Opportunities
</li>
<li class="">Student Services
</li>
</ul>
</li>
<li class="hidden-xs dropdown-submenu">
Courses<b class="caret"></b>
</li>
<!-- if submenu. repeats previous code but this will show ONLY on MOBILE to expose third tier navigation -->
<li class="visible-xs dropdown-submenu">
Courses<b class="caret"></b>
<ul class="dropdown-menu sub-menu" role="menu">
<li class="
active 3">
<a href="/courses/undergraduate/2015/SU" role="menuitem">
Summer
2015
• Undergraduate
</a>
</li>
<li class="
">
<a href="/courses/undergraduate/2015/SP" role="menuitem">
Spring
2015
• Undergraduate
</a>
</li>
<li class="
active 3">
<a href="/courses/graduate/2015/SU" role="menuitem">
Summer
2015
• Graduate
</a>
</li>
<li class="
">
<a href="/courses/graduate/2015/SP" role="menuitem">
Spring
2015
• Graduate
</a>
</li>
</ul>
</li>
<li class="">
Financial Aid
</li>
<li class="">
Student Prizes and Awards
</li>
</ul>
</li>
<li class="nav-dot">
<img src="http://assets-production-webvanta-com.s3-us-west-2.amazonaws.com/000000/51/21/original/images/dot.png" alt="" role="presentation">
</li>
<!--if submenu-->
<li class="dropdown ">
Prospective Students<b class="caret"></b>
<ul class="dropdown-menu" role="menu">
<li class="">
Why Berkeley Astronomy
</li>
<li class="">
Tuition
</li>
<li class="">
UNEX and Summer Sessions
</li>
<li class="">
About Berkeley
</li>
<li class="">
Statement on Diversity
</li>
</ul>
</li>
<li class="nav-dot">
<img src="http://assets-production-webvanta-com.s3-us-west-2.amazonaws.com/000000/51/21/original/images/dot.png" alt="" role="presentation">
</li>
<!--if submenu-->
<li class="dropdown ">
Research & Facilities<b class="caret"></b>
<ul class="dropdown-menu" role="menu">
<li class="">
Facilities
</li>
<li class="">
Organized Research Units
</li>
<li class="">
Research Opportunities
</li>
<li class="">
Projects
</li>
<li class="">
Labs
</li>
<li class="">
Libraries
</li>
</ul>
</li>
<li class="nav-dot">
<img src="http://assets-production-webvanta-com.s3-us-west-2.amazonaws.com/000000/51/21/original/images/dot.png" alt="" role="presentation">
</li>
<!--if submenu-->
<li class="dropdown ">
Department Resources<b class="caret"></b>
<ul class="dropdown-menu" role="menu">
<li class="">
Forms and Documents
</li>
<li class="">
Computing at Berkeley Astronomy
</li>
<li class="">
Campus Shared Services
</li>
<li class="">
Access & Building
</li>
<li class="">
Hosting Speakers & Visitors
</li>
<li class="">
Building Procedures
</li>
<li class="">
Campus Resources
</li>
</ul>
</li>
<li class="nav-dot">
<img src="http://assets-production-webvanta-com.s3-us-west-2.amazonaws.com/000000/51/21/original/images/dot.png" alt="" role="presentation">
</li>
<!--if submenu-->
<li class="dropdown last-li">
Friends & Fans<b class="caret"></b>
<ul class="dropdown-menu" role="menu">
<li class="">
Outreach
</li>
<li class="">
Make A Gift
</li>
<li class="">
Ask an Astronomer
</li>
<li class="">
Local Resources
</li>
<li class="">
Department Merchandise
</li>
</ul>
</li>
</ul>
<form action="/search" class="search_form visible-xs navbar-form navbar-right" method="post" role="search">
<div class="input-group">
<input class="form-control input-sm search_text" name="search_text" type="text" placeholder="">
<span class="input-group-btn">
<button type="submit" class="btn btn-color btn-sm"><span class="glyphicon glyphicon-search"></span><span class="sr-only">Search</span>
</button>
</span>
</div>
</form>
</div>
</div>
</div>
</div>
I have yet to find a work around. Any ideas?
If I understand correct this issue comes up whenever the landscape tabs are open. You will be unable to either open/or close the mobile menu.
I managed to fix it with a workaround:
Make an absolute positioned div(with id #ios_menu_fix in this case) about the size of the toggle button.
In css align it where the toggle button would be in the fixed nav menu. Make sure it has z-index set and also -webkit-transform: translate3d(0,0,0); to fix ios z-index issue when scrolling up.
Every time page is scrolled set the top to page scrolled height like so:
$(window).on('scroll',function() {
$("#ios_menu_fix").css("top", $(document).scrollTop()+"px");
});
Open/close the menu when #ios_menu_fix is clicked
$(".nav-collapse").collapse('hide');
$(".nav-collapse").collapse('show');
You can check if the menu is open like so:
var toggle = $(".nav-collapse").is(":visible");
if (toggle) {
$(".nav-collapse").collapse('hide');
}
else {
$(".nav-collapse").collapse('show');
}
Its an ugly solution but the only one I currently find working that doesn't break other mobile browsers and layouts.
These code examples use JQuery.

Getting the attribute value of anchor tag in UL

<div class="content">
<ul class="clean menu" id="topics">
<li class="drop png">
<div>
<span href="#" id="phone" style="BACKGROUND-POSITION: 13px -79px">Phone</span>
</div>
<ul class="clean menu sub">
<li>
<a cat="tech" class="sec_phone_0" href="javascript:void(0);" name="&lid=choose_category_phone_digital" rel="1">FiOS Digital Voice</a>
</li>
<li class="last">
<a cat="tech" class="sec_phone_1" href="javascript:void(0);" name="&lid=choose_category_phone_dialup" rel="1">Home Phone(Copper)</a>
</li>
<li class="last">
<a cat="tech" class="sec_phone_2" href="javascript:void(0);" name="&lid=choose_category_phone_fiosVoice" rel="1">FiOS Voice</a>
</li>
<li class="last" style="margin-bottom:7px;">
<a cat="tech" class="sec_phone_2" href="javascript:void();" name="&lid=choose_category_phone_wireless" rel="1">Verizon Wireless</a>
</li>
</ul>
</li>
</ul>
</div>
Now I need to select the "cat" value of Fios Voice. How can I do this in Mootools v1.3.2?
Need to set the value in cookie.
This script gets the property of link on click event.
window.addEvent('domready',function(){
$$('ul.sub')[0].getElements('a').each(function(el,ind){
el.addEvent('click',function(){
var cat = el.getProperty('cat');
alert(cat)
})
})
})
For case when <a cat="tech1" class="sec_phone_0 active" href="javascript:void(0);" name="&lid=choose_category_phone_digital" rel="1">FiOS Digital Voice</a> has class="active"
window.addEvent('domready',function(){
if($$('ul.sub')[0].getElements('a.active')[0]){
var cat = $$('ul.sub')[0].getElement('a.active').getProperty('cat');
alert(cat);
}
})