Re: click-through to underlying element
"RobB" <ferndoc9@hotma il.com> wrote in message
news:1112925560 .682317.191500@ o13g2000cwo.goo glegroups.com.. .[color=blue]
> Uses the regular expression /\bscroll\b/, which will match the string
> 'scroll' (could have used /^scroll$/ or simply /scroll/ also); if it
> matches, RegExp.test returns true which assigns 'hidden' to the
> overflowX property, otherwise assigning 'scroll'. A toggle, in other
> words.[/color]
Ah, yes. I understand the toggle, I wasn't clear on the use of the regex.
Isn't
obj.style.overf low = (obj.style.over flow=='auto') ? 'hidden' : 'auto';
more efficient, and testing on the numeric value of zIndex more efficient
still? Having determined the zIndex, other tests are unnecessary, and one
'if()' is more efficient than multiple toggles.
[color=blue]
> Same for the overflow property. Setting both is required to suppress
> the vertical scrollbar cross-browser.[/color]
I was under the impression overflowX was a subset of overflow, setting
overflow sets both overflowX and overflowY.
[color=blue]
> if ('undefined' != typeof obj.scrollLeft)
> obj.scrollLeft = 0;
>
> Returns image to flush left if 'unexpanded'. Seemed logical.[/color]
Good idea! Thanks.
Your 2nd solution looks good, tho it seems to me either an empty div or a
1-pixel-high totally-transparent gif sized with CSS to the overlapping area
would work better than a clipped duplicate of the overlapped image. On the
off chance of no stylesheet support, it wouldn't significantly affect
appearance. I put " " in my overlapping div out of fear that some
browser might ignore a click on an empty element, but perhaps that isn't
necessary. It works without it in IE and FF.
nf
"RobB" <ferndoc9@hotma il.com> wrote in message
news:1112925560 .682317.191500@ o13g2000cwo.goo glegroups.com.. .[color=blue]
> Uses the regular expression /\bscroll\b/, which will match the string
> 'scroll' (could have used /^scroll$/ or simply /scroll/ also); if it
> matches, RegExp.test returns true which assigns 'hidden' to the
> overflowX property, otherwise assigning 'scroll'. A toggle, in other
> words.[/color]
Ah, yes. I understand the toggle, I wasn't clear on the use of the regex.
Isn't
obj.style.overf low = (obj.style.over flow=='auto') ? 'hidden' : 'auto';
more efficient, and testing on the numeric value of zIndex more efficient
still? Having determined the zIndex, other tests are unnecessary, and one
'if()' is more efficient than multiple toggles.
[color=blue]
> Same for the overflow property. Setting both is required to suppress
> the vertical scrollbar cross-browser.[/color]
I was under the impression overflowX was a subset of overflow, setting
overflow sets both overflowX and overflowY.
[color=blue]
> if ('undefined' != typeof obj.scrollLeft)
> obj.scrollLeft = 0;
>
> Returns image to flush left if 'unexpanded'. Seemed logical.[/color]
Good idea! Thanks.
Your 2nd solution looks good, tho it seems to me either an empty div or a
1-pixel-high totally-transparent gif sized with CSS to the overlapping area
would work better than a clipped duplicate of the overlapped image. On the
off chance of no stylesheet support, it wouldn't significantly affect
appearance. I put " " in my overlapping div out of fear that some
browser might ignore a click on an empty element, but perhaps that isn't
necessary. It works without it in IE and FF.
nf
Comment