Lionel

Lionel


  • Name: [not set]
  • Favorite Languages: [not set]
  • Website: [not set]
  • Location: [not set]
  • About Me: [not set]

Recent Comments

  • Javascript Tutorial - Draggable View In A Container
    05/20/2010 - 13:17

    Is there an easy way to have jump to a specific "view" of the image?

    I tried defining a function

      function moveIt(mvTop, mvLeft) {
        obj=document.getElementById('draggableElement');
            obj.style.position = "absolute";
            obj.style.top = mvTop;
            obj.style.left = mvLeft;
      }

    and then call it as
    < a href="javascript:moveIt(-1000,-1000);" > ...
    but that just does nothing (without flagging any errors).

    I pretty sure I'm missing something obvious and simple so any solution (or even a hint) would be much appreciated.

    [Edit] Never mind. I was missing something obvious as suspected (i.e. it helps to tell the function that the mvLeft and mvTop values are pixels). Am an idiot.

Sponsors