Clipping Question

admin

Administrator
Staff member
Hello all,
I have tried alot of things but could not figure it out myself so here is my question regarding clipping with css.

First off, here is the page that produces the problem (<!-- m --><a class="postlink" href="http://www.wasimmer.de/scripts/css_clip.html">http://www.wasimmer.de/scripts/css_clip.html</a><!-- m -->)

I have setup a little javascript to bind the image to the x-coordinate of the mouse, to create a sliding effect, this works great, however if the x-coordiante reaches a certain amount (in my case 318 with a resolution of 1152x864) the horizontal scrollbar appears, which is unwanted and I want to get rid off. I set the clip overflow parameter to hidden (which after my research should be the right option) but I have also tried the others and they produced the same result.

The Problem only persists in IE, Mozilla displays it correctly without any scrollbar. I really appreciate any help you might be able to offer, Thanks!The way I see it, you could try one of two things, the first one being, change posLeft to just left (since I've never even heard of posLeft, and you can ditch the evals, you don't need them), like this:

document.image.hspace=tempX;
document.getElementById('image').style.left=tempX;

The other option would be to limit how far the image can go across the screen (since it is only visible inside the orange/brown box), as you have commented out here:

// Scrollbarschutz
//if (tempX > 355){tempX = 355}Thanks alot for your input lavalamp, it certainly helped me get it right. Just for future reference i'll explain what I changed:

I forgot to comment out
document.image.hspace=tempX;
which, to my knowledge, caused the scrollbar to appear.
Then I changed the next line to
document.getElementById("image").style.left = tempX + "px"

Everything works like a charm now. Thanks again.Happy to partially help. :)

I didn;t spot the missing px and I wasn't too sure what the other line did so I left it as it was.
 
Back
Top