I finally make it worked !

Here is what I had to do:

1/ First, as you said, we have to load setupZoom() every time a new
page loads (Ajax), so I added a call to setupZoom() in the slideDone()
function (iui.js).

Then it didn't worked yet, because the setupZoom() will append the
zoombox just after the body tag, which was an issue because it was
hidden by the toolbar or something else.

2/ So I had to change a little thing in the insertZoomHTML() function,
which is located in FancyZoomHTML.js :
Line 12:
var inBody = document.getElementsByTagName("body").item(0);
by
var inBody = document.getElementsByTagName("div").item(0);

In order to append the zoombox after the div, instead of the body tag.

And it worked!!! ;-)
Now I just have to customize the zoombox to make it larger (because it
doesn't zoom very larger).

Thanks,

Charles

On Dec 21, 10:10 am, Charles H <char...@cableorganizer.com> wrote:
> Thanks Dave, I'll look into that and let you know if it worked.
>
> Regards,
>
> Charles
>
> On Dec 18, 3:40 pm, ltlfrari <ltlfr...@gmail.com> wrote:
>
>
>
> > Not sure if this will work but might be worth a try.
>
> > From what I understand you need to execute the setupZoom function
> > 'each' time you get a new page from the back end.
>
> > First off, you need to include the fancyZoom javascripts in the head
> > of the initial page you send to the device, ie the same place as you
> > specify the iui scripts etc.
> > If you have images in the initial page you want to zoom enable, call
> > the setupZoom function after the inital page loads. This only works
> > for the initial page load because after that iUI is obtaining the data
> > via Ajax and inserting the results into the DOM itself so any
> > javascript never gets execute.
>
> > What you need to do (I think) is capture the new page load event and
> > invoke the setupZoom function again. I don't know if executing
> > setupzoom multiple time will cause any problems though, something to
> > experiment with.
>
> > What I have done is to add this code as a script to my main page head
> > section so that it executes when the page loads, it sets up an event
> > listenr to capture the 'aftertransition' (iUI 0.40) event and use that
> > to execute some javascript (like this in your case):
>
> > addEventListener("aftertransition", function(event)
> > {
> >         if (event.out == false) {
>
> >            setupZoom();
>
> >         }
>
> > }
>
> > Each time you go to a new page (external from a server OR internal
> > bookmarked page) it will run the setupZoom function after the new page
> > is displayed. you could change the vent.out == false to vent.out ==
> > true to do that on the old page out event instead.
>
> > Like I say, I have no idea if executing setupZoom multiple times is a
> > bad thing or not.
>
> > Hope that helps
>
> > Dave E

--

You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to iphoneweb...@googlegroups.com.
To unsubscribe from this group, send email to 
iphonewebdev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.


Reply via email to