Evlich
03-22-2003, 12:57 AM
Hello, I am working with clippers and for some reason, I can't get this stuff to work. Here is what I am doing:
<div class="rWindow">
<div class="rWindowTitle">Scroller Test</div>
<div class="rWindowContent">
<div id="spacer0" style="height: 200px; width: 100%;" onclick="pauseresume(0);">
<div id="scroller0" style="position: absolute; top: 0px; left: 0px;">
</div>
</div>
<script type="text/javascript" language="javascript1.2">
addScroller(100);
addScrollerText(0, "Scroller Test");
addScrollerText(0, "This is a test of the emergency broadcast system.");
</script>
</div>
</div>
When the page is loaded, I run this function:
function initAllScrollers()
{
for( i = 0; i < scroller.length; i++)
{
scroller[i][0] = getElement("spacer"+i);
scroller[i][1] = getElement("scroller"+i);
scroller[i][1].style.top = getPageTop(scroller[i][0])+"px";
scroller[i][1].style.left = getPageLeft(scroller[i][0])+"px";
scroller[i][1].style.width = scroller[i][0].offsetWidth + "px";
//TODO: work with this
clipLayer(scroller[i][1], getPageLeft(scroller[i][0]), getPageTop(scroller[i][0]), getPageLeft(scroller[i][0])+scroller[i][0].offsetWidth, getPageTop(scroller[i][0])+scroller[i][0].offsetHeight);
alert( scroller[i][1].style.clip );
scroller[i][1].innerHTML = scroller[i][4];
timers[ind] = window.setTimeout('update('+ind+')', scroller[ind][2]);
}
}
My problem is that the clipper isn't working. When I clip spacer0, it is like the clipper isn't working at all and when I clip scroller0, I get absolutely nothing to show up. The clipLayer() function is the one from dhtmllib.js
function clipLayer(layer, clipleft, cliptop, clipright, clipbottom)
{
if (isMinNS4) {
layer.clip.left = clipleft;
layer.clip.top = cliptop;
layer.clip.right = clipright;
layer.clip.bottom = clipbottom;
}
if (isMinIE4)
layer.style.clip = 'rect(' + cliptop + 'px ' + clipright + 'px ' + clipbottom + 'px ' + clipleft +'px)';
}
I messagebox the clip of the object that I have and it looks perfect. Can someone give me an idea as to what might be the problem? Thanks a lot. I really appreciate it.
~evlich
<div class="rWindow">
<div class="rWindowTitle">Scroller Test</div>
<div class="rWindowContent">
<div id="spacer0" style="height: 200px; width: 100%;" onclick="pauseresume(0);">
<div id="scroller0" style="position: absolute; top: 0px; left: 0px;">
</div>
</div>
<script type="text/javascript" language="javascript1.2">
addScroller(100);
addScrollerText(0, "Scroller Test");
addScrollerText(0, "This is a test of the emergency broadcast system.");
</script>
</div>
</div>
When the page is loaded, I run this function:
function initAllScrollers()
{
for( i = 0; i < scroller.length; i++)
{
scroller[i][0] = getElement("spacer"+i);
scroller[i][1] = getElement("scroller"+i);
scroller[i][1].style.top = getPageTop(scroller[i][0])+"px";
scroller[i][1].style.left = getPageLeft(scroller[i][0])+"px";
scroller[i][1].style.width = scroller[i][0].offsetWidth + "px";
//TODO: work with this
clipLayer(scroller[i][1], getPageLeft(scroller[i][0]), getPageTop(scroller[i][0]), getPageLeft(scroller[i][0])+scroller[i][0].offsetWidth, getPageTop(scroller[i][0])+scroller[i][0].offsetHeight);
alert( scroller[i][1].style.clip );
scroller[i][1].innerHTML = scroller[i][4];
timers[ind] = window.setTimeout('update('+ind+')', scroller[ind][2]);
}
}
My problem is that the clipper isn't working. When I clip spacer0, it is like the clipper isn't working at all and when I clip scroller0, I get absolutely nothing to show up. The clipLayer() function is the one from dhtmllib.js
function clipLayer(layer, clipleft, cliptop, clipright, clipbottom)
{
if (isMinNS4) {
layer.clip.left = clipleft;
layer.clip.top = cliptop;
layer.clip.right = clipright;
layer.clip.bottom = clipbottom;
}
if (isMinIE4)
layer.style.clip = 'rect(' + cliptop + 'px ' + clipright + 'px ' + clipbottom + 'px ' + clipleft +'px)';
}
I messagebox the clip of the object that I have and it looks perfect. Can someone give me an idea as to what might be the problem? Thanks a lot. I really appreciate it.
~evlich