Jump to content

Recommended Posts

An array is just a data structure, it only holds data. If you want to do animation in Javascript then you need to use timeouts. If you search for Javascript animation you should be able to find several examples.


The basic idea is that you use CSS to move the position of an element, and you set it up to run a function maybe every 10 milliseconds which moves the element by a little bit, until it's where you want it. Javascript uses setTimeout and setInterval to run a function later. So you could do something like this to move an element left by 100 pixels:

function move_element(id) {  var el = document.getElementById(id);  var target = -100;  var current = parseInt(el.style.left, 10);  if (isNaN(current)) {    current = 0;  }  current--;  el.style.left = current + 'px';  if (current != target) {    setTimeout('move_element("' + id + '")', 10);  }} move_element('some_id');
Link to post
Share on other sites

I'd like to know where these terms are defined and by who.


Slider? Modal? Lightbox?


Do these words have well defined meanings or are they vague concepts?


What other words are in this vocabulary?

Edited by davej
Link to post
Share on other sites

I guess a slider is something that slides. A modal box is a box that blocks everything else, where you can't click on anything other than the box. Javascript's alert box is modal, you can't interact with the rest of the page while an alert box is open, you need to close the alert first. Lightbox is probably a brand name that people made into a generic term, like Xerox or Kleenex.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...