www.webdeveloper.com
Results 1 to 2 of 2

Thread: Image Placement Problem

  1. #1
    Join Date
    Feb 2011
    Posts
    2

    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?

    Code:
    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(){
    	clearInterval(c);	
    }
    This code is repeated for each direction, just different a/b operations.

    Code:
    <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%;" />
    </div>
    
    This is the html containing the image.  I also tried using buttons instead of the divs, same problem.

  2. #2
    Join Date
    Feb 2011
    Posts
    2
    http://tylercooper.webuda.com/Designs/Valentines/

    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



Recent Articles