--
You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group.
To post to this group, send email to iphone...@googlegroups.com.
To unsubscribe from this group, send email to iphonewebdev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
p.s. I just saw my post and in retrospect it sounds kind of snarky. I
don't mean to be. I'm truly amazed at how much specific help folks on
this list have received when the post a link to a page/site that is
having a problem.
If your project is confidential, but you are having basic problem with
Safari/WebKit/iUI/PHP/Whatever you should be able to create a simple
reduction that demonstrates the issue and post that.
-- Sean
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
Regards,
Charles
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