Jump to content

bchavdarov

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About bchavdarov

  • Rank
    Newbie
  1. davej, I modified a little your code in order to work in IE and that's what I got: <!DOCTYPE html><html><head><meta charset="utf-8"><title>Drag Me</title><style>#dragme{position:absolute;display:none;height:100px;width:100px;background-color:#eee;border:1px solid black;border-radius:15px;text-align:center;}</style><script>var mousex;var mousey;var move = false;var ldivx = 200;var ldivy = 200;var IE = document.all?true:false;if (!IE) document.captureEvents(Event.MOUSEMOVE)window.onload = init;function init() {var d = document.getElementById
  2. Found the solution. In fact element.style.left (or top) can be used to get values from inline styles. I tried to use the above functions and I only switched from external style sheet to internal and they worked. If we use external or internal style sheet they won't work. So I modified the functions like this: function getx() { var bg = document.getElementById("innercont"); var curleft = 0; if (bg.offsetParent) do { curleft += bg.offsetLeft; } while (bg = bg.offsetParent); return curleft;} and they work just fine
  3. Hello, Recently i faced a problem which seems very odd to me and I would like to find the answer or at least acceptable explanation. But let's go straight to it. Let's have two divs one inside the other - the code is something like: <div id="imgframe"> <div id="innercont" class="dragme"> <a class="marker" style="left: 1060px; top:658px;" onclick="movepos(1060, 658)"></a> </div></div><button type="button" onclick="displayattr()">Test</button> they are styled with css like this: #imgframe { width: 950px; height: 600px; overflow: hidden;}#i
×
×
  • Create New...