Click here to Skip to main content
15,881,516 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionCompare the Triplets | Printing two values. Pin
Manish16918-Jan-20 20:53
Manish16918-Jan-20 20:53 
AnswerRe: Compare the Triplets | Printing two values. Pin
phil.o18-Jan-20 22:09
professionalphil.o18-Jan-20 22:09 
QuestionHow I can close current tab in a browser window using JavaScript? Pin
Member 1471392612-Jan-20 2:40
Member 1471392612-Jan-20 2:40 
AnswerRe: How I can close current tab in a browser window using JavaScript? Pin
Blikkies13-Jan-20 5:08
professionalBlikkies13-Jan-20 5:08 
GeneralRe: How I can close current tab in a browser window using JavaScript? Pin
Member 1471392613-Jan-20 5:16
Member 1471392613-Jan-20 5:16 
QuestionRe: How I can close current tab in a browser window using JavaScript? Pin
ZurdoDev13-Jan-20 6:19
professionalZurdoDev13-Jan-20 6:19 
AnswerRe: How I can close current tab in a browser window using JavaScript? Pin
Richard Deeming13-Jan-20 8:04
mveRichard Deeming13-Jan-20 8:04 
GeneralRe: How I can close current tab in a browser window using JavaScript? Pin
ZurdoDev13-Jan-20 8:27
professionalZurdoDev13-Jan-20 8:27 
GeneralRe: How I can close current tab in a browser window using JavaScript? Pin
F-ES Sitecore13-Jan-20 22:24
professionalF-ES Sitecore13-Jan-20 22:24 
GeneralRe: How I can close current tab in a browser window using JavaScript? Pin
Blikkies14-Jan-20 20:10
professionalBlikkies14-Jan-20 20:10 
QuestionJSON: How to insert URL in the child node? (Output is HTML file) Pin
TapCha910-Jan-20 1:02
TapCha910-Jan-20 1:02 
AnswerRe: JSON: How to insert URL in the child node? (Output is HTML file) Pin
F-ES Sitecore10-Jan-20 1:36
professionalF-ES Sitecore10-Jan-20 1:36 
QuestionGuys Please help me , How do I link this HTML with Css and Js properly? Pin
Member 147047841-Jan-20 19:46
Member 147047841-Jan-20 19:46 
QuestionHow do you pause an animation? Pin
Marc Hede18-Dec-19 2:55
Marc Hede18-Dec-19 2:55 
QuestionImages are not loading that are referenced in CSS Pin
simpledeveloper17-Dec-19 13:10
simpledeveloper17-Dec-19 13:10 
AnswerRe: Images are not loading that are referenced in CSS Pin
Richard MacCutchan17-Dec-19 21:54
mveRichard MacCutchan17-Dec-19 21:54 
GeneralRe: Images are not loading that are referenced in CSS Pin
simpledeveloper18-Dec-19 7:34
simpledeveloper18-Dec-19 7:34 
GeneralRe: Images are not loading that are referenced in CSS Pin
Richard MacCutchan18-Dec-19 21:22
mveRichard MacCutchan18-Dec-19 21:22 
GeneralRe: Images are not loading that are referenced in CSS Pin
F-ES Sitecore20-Dec-19 4:03
professionalF-ES Sitecore20-Dec-19 4:03 
GeneralRe: Images are not loading that are referenced in CSS Pin
simpledeveloper20-Dec-19 8:23
simpledeveloper20-Dec-19 8:23 
QuestionHow do I close this menu automatically after clicking link? Pin
Melissa Anthonia17-Dec-19 8:38
Melissa Anthonia17-Dec-19 8:38 
Greetings.
I am working on a one-page solution where each section has an ID.
I have made this very simple responsive menu, which looks quite nice, but I have noticed one major flaw.
In mobile view, if I click on a list from the navbar slide-menu, the page will scroll down to that particular ID. The problem is that the user needs to click on the navbar to manually close it, meaning that if they click on one of the links, they won't actually know if they are taken to that section, because the menu is in the way.

What I want is for the menu to close after clicking the link, so that people can see the page scrolling down to the section they were looking for.
How can I accomplish this?

If possible I would like an ES6 solution without JQuery

JavaScript
console.clear();
const navSlide= ()=> {
    const burger = document.querySelector('.burger');
    const nav = document.querySelector('.nav-links');
    const navLinks=document.querySelectorAll('.nav-links li');
 //Toggle Nav
    
    burger.addEventListener('click', () =>{
        nav.classList.toggle('nav-active');

    navLinks.forEach((link,index) =>{
       if(link.style.animation) {
           link.style.animation=''
        } else {

            link.style.animation=`navLinkFade 0.5s ease forwards ${index /7 + 0.2}s`;
        }
        console.log(index / 7);
    });
		burger.classList.toggle('toggle');
 });
}

navSlide();


modified 17-Dec-19 15:03pm.

QuestionAttempted to register a view with an id already in use: 2 - EmberJs Pin
simpledeveloper10-Dec-19 14:29
simpledeveloper10-Dec-19 14:29 
GeneralRe: Attempted to register a view with an id already in use: 2 - EmberJs Pin
Richard MacCutchan10-Dec-19 21:56
mveRichard MacCutchan10-Dec-19 21:56 
AnswerRe: Attempted to register a view with an id already in use: 2 - EmberJs Pin
F-ES Sitecore10-Dec-19 22:32
professionalF-ES Sitecore10-Dec-19 22:32 
GeneralRe: Attempted to register a view with an id already in use: 2 - EmberJs Pin
simpledeveloper11-Dec-19 5:53
simpledeveloper11-Dec-19 5:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.