Results 1 to 2 of 2

Thread: Image Placement Problem

  1. #1
    Join Date
    Feb 2011

    Unhappy Image Placement Problem

    I've been trying to set up this project to move an image (via hspace/vspace) when I mouse over a certain div. The divs are layed out in a 3 x 3 grid, each corresponding to a particular direction. Sometimes it works, other times it ignores either the vspace or hspace movement.. or does nothing all together. Any help on this?

    var a = 0;
    var b = 0;
    var c = 0;
    // Move Up and Left
    function move1(){
    	a = document.getElementById("note").hspace;
     	b = document.getElementById("note").vspace;
     a += 1;
     b += 1;
     	document.getElementById("note").hspace = a; 
    	document.getElementById("note").vspace = b;
    function moveover1(){
    c = setInterval("move1()",10);
    function moveout1(){
    This code is repeated for each direction, just different a/b operations.

    <div style="position: absolute; width: 750px; height: 555px; top: 20%; left: 23%; z-index: -1; overflow: hidden;">
    <img src="note.jpg" id="note" alt="" vspace="0" hspace="0" style="position: absolute; top: -130%; left: -85%;" />
    This is the html containing the image.  I also tried using buttons instead of the divs, same problem.

  2. #2
    Join Date
    Feb 2011

    Heres a link to what I've got so far if that is helpful

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center