Jump to content


Photo
- - - - -

Html


  • Please log in to reply
3 replies to this topic

#1 Harut

Harut

    Վերնագիր

  • Members
  • PipPipPipPipPip
  • 5,734 posts
  • Gender:Male
  • Location:հորիզոն...
  • Interests:uninterested...

Posted 11 July 2003 - 05:48 PM

why doesn't changing the 'offset' make any difference?

<html>
<head>
<script language="JavaScript">
  function drag() {
    dragMe.style.left=event.clientX;
    dragMe.style.top=event.clientY;
  }

  var offset=10;

  function rock() {
    offset=!offset;
    rockMe.style.top=200+offset;
    rockMe.style.left=100+offset;
    inter=setTimeout("rock()",100);
  }
</script>
</head>

<body>
  <img src="dg.gif" id="dragMe" onDrag="drag()" style="position:absolute;left:100">

  <input type="button" id="rockMe" value="Rock Me" onMouseOver="rock()" onMouseOut="clearTimeout(inter)" 

style="position:absolute;left:100;top:200">
</body>
</html>


#2 Sip

Sip

    Buffet Connoisseur

  • Members
  • PipPipPipPipPip
  • 8,366 posts
  • Gender:Male
  • Location:Online

Posted 11 July 2003 - 06:15 PM

offset=!offset

! is the logical NOT operation ... if offset is non-zero, !offset will become 0. If offset is 0, !offset should be 1 I think. So it really only depends if offset is zero or not.

#3 Harut

Harut

    Վերնագիր

  • Members
  • PipPipPipPipPip
  • 5,734 posts
  • Gender:Male
  • Location:հորիզոն...
  • Interests:uninterested...

Posted 11 July 2003 - 07:16 PM

ay ay ay

thanks

offset=-offset

#4 Harut

Harut

    Վերնագիր

  • Members
  • PipPipPipPipPip
  • 5,734 posts
  • Gender:Male
  • Location:հորիզոն...
  • Interests:uninterested...

Posted 11 July 2003 - 07:19 PM

btw, the drag feature is pretty cool




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users