Click here to Skip to main content
14,663,832 members
Home » Discussions » JavaScript
   

JavaScript

 
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
mveZurdoDev13-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
mveF-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
MemberTapCha910-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
mveF-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
MemberMember 147047841-Jan-20 19:46 
QuestionHow do you pause an animation? Pin
Marc Hede18-Dec-19 2:55
MemberMarc Hede18-Dec-19 2:55 
I am making a live subway map, where I have divs representing trains, moving up and down the map.
I had no problem making them move, but I would like them to stop for a few seconds at each station.
Can someone tell me how I can include this in my code?
What line do I need to add, and where?

window.onload = () => {
    startSetTimeoutAnimation();
  };
  
  function startSetTimeoutAnimation() {
    const refreshRate = 1000 / 60;
    const maxXPosition = 400;
    let rect = document.getElementById('rect0');
    let speedX = 0.01;
    let positionX = 25;
  
    window.setInterval(() => {
      positionX = positionX + speedX;
      if (positionX > maxXPosition || positionX < 25) {
        speedX = speedX * (-1);
      }
      rect.style.top = positionX + 'px';
    }, refreshRate);
    
  }

QuestionImages are not loading that are referenced in CSS Pin
simpledeveloper17-Dec-19 13:10
Membersimpledeveloper17-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
Membersimpledeveloper18-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
mveF-ES Sitecore20-Dec-19 4:03 
GeneralRe: Images are not loading that are referenced in CSS Pin
simpledeveloper20-Dec-19 8:23
Membersimpledeveloper20-Dec-19 8:23 
QuestionHow do I close this menu automatically after clicking link? Pin
Melissa Anthonia17-Dec-19 8:38
MemberMelissa Anthonia17-Dec-19 8:38 
QuestionAttempted to register a view with an id already in use: 2 - EmberJs Pin
simpledeveloper10-Dec-19 14:29
Membersimpledeveloper10-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
mveF-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
Membersimpledeveloper11-Dec-19 5:53 
GeneralRe: Attempted to register a view with an id already in use: 2 - EmberJs Pin
Natalie-9015-Dec-19 5:11
MemberNatalie-9015-Dec-19 5:11 
GeneralRe: Attempted to register a view with an id already in use: 2 - EmberJs Pin
jkirkerx11-Dec-19 12:23
professionaljkirkerx11-Dec-19 12:23 
GeneralRe: Attempted to register a view with an id already in use: 2 - EmberJs Pin
simpledeveloper12-Dec-19 6:22
Membersimpledeveloper12-Dec-19 6:22 
AnswerRe: Attempted to register a view with an id already in use: 2 - EmberJs Pin
Pete O'Hanlon12-Dec-19 0:02
subeditorPete O'Hanlon12-Dec-19 0:02 
GeneralRe: Attempted to register a view with an id already in use: 2 - EmberJs Pin
simpledeveloper12-Dec-19 6:26
Membersimpledeveloper12-Dec-19 6:26 
QuestionI need to add “Add new item” option in Select2 Pin
Shraddha_Patel3-Dec-19 17:32
MemberShraddha_Patel3-Dec-19 17:32 

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.