You can try to add some delay to the script (with setTimeout) when browsing the page in edit-mode.
Sorry for the delayed replay, but this method worked a treat.
At a client's request I've recently added some JQuery to apply rounded corners to a number of images on a site.
This all works fine expect when previewing the page in the backend of the CMS, atwhich point the code still runs, but the results are not as expected!
Has anyone encountered this before?