problem integrating jquery UI draggable and my own code

problem integrating jquery UI draggable and my own code

Hellow folks,

I am very new to jQueryUI. have implemented the code of draggable into a page with 144 images. and if works fine, as seen in here.

The problem occurs when trying to write a custom function to load images, when they fly out of the main div ( container ). We need a setup, that when an image is out of the black area, it will automatically be shown from the other side ( if it slips our from right, it will be shown from left ).

My function PUSHIT () works correctly at this stage. but the problem is, if you click and drag the newly-loaded images, the old images will all be gone!

can you help me please?

Note: please do not point me to use Panoramic jQuery scripts. the situation is different.

Thanks a lot.

here is the code, so far.