[_] strange safari chaching bug
Matt Kane
ascorbic at gmail.com
Fri Dec 1 13:25:19 GMT 2006
On 1 Dec 2006, at 13:17, s'unya wrote:
> Hi,
>
> I am encountering a strange bug in safari (works in all other
> browsers).
> Basically I have an accordian style info widget that uses JS to
> hide the
> submenu until clicked on. The JS works by setting the style
> attribute onload
> ("style", "position:absolute;left:-999em;") and then, when clicked
> upon,
> sets it again so that it is position:relative; left 0;... In
> safari the
> initial hiding mechanism works, but when clicking, it runs the JS
> to display
> fine (no errors and executes and alert which demonstrates that the
> stle has
> been set), but doesn't update the display to reflect the style
> change. I
> believe this is because the styles are being cached... but I may be
> wrong.
>
> My knowledge has run out and I am hoping one of the JS/Mac giants
> might have
> an answer. If it is the syle chache, can I force safari to refresh the
> display without refreshing the page? Or is it some other thing?
You want to set theElement.style.position ='relative'; and
theElement.style.left = '0';