PDA

View Full Version : magnify and paginate



commic
07-14-2012, 10:35 AM
It seems that this is not an exclusive Ajax problem.

I'm using a js paginated page and a (zoom) script that is loaded after the complete page is loaded. The script only works in the initial loaded virtual page.
As soon as I click to the next item, the (zoom) script stops working.

jscheuer1
07-14-2012, 03:16 PM
Which scripts are those?

Anyways, if content on a page is changed and the load event for the page has passed, often a script will stop functioning.

This need not be.

Many scripts are written to look for all elements that fit certain criteria and assign click and/or hover events to them.

If instead these scripts listened to the page for click and/or hover events and reacted to them if the trigger element fit those criteria, then new content would work without having to be initialized.

Or, after new content arrives, it can be initialized. That's one of the things that instance.onajaxpageload can be used for (example using the alert):


<script type="text/javascript">

var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()

countries.onajaxpageload = function(pageurl){
if (pageurl.indexOf("external4.htm") != -1){
alert('Hello');
}
};

</script>

commic
07-18-2012, 12:24 PM
Hi John,

Though I understand you're explanation, I can not make the changes to make this work.

I'm using two DynamicDrive scripts:
jQuery Image Magnify script v1.1 and Virtual Pagination Script

The magnify routine works only for the initial loaded virtual page (block). After going to the next, it stops working. Though a very small black dot is visible and responds to the 'closing' of the magnified image.

Thanks,
John

jscheuer1
07-18-2012, 01:19 PM
OK, well I've moved this over to a new thread copying just the relevant posts for your problem. In the future, please start a new thread for a new question.

Now of course there is no instance.onajaxpageload with those scripts. But they probably have some similar juncture where we can reinitialize the magnify script, or we can perhaps use the other method I mentioned. There may need to be some other solution here. And to avoid misunderstanding, please post a link to each Dynamic Drive script you are using. Give:

1) Script Title:

2) Script' Demo Page URL (on DD):

for each one. Also please include a link to the page on your site where you're using the two scripts so I can see the problem.