views:

43

answers:

1

This is probably not all that difficult, because otherwise iäm sure i wouldv'e found the answer somewhere...

What i want to do i open up a fancybox (the jquery plugin), loading it whith ajax-content, and when i click a link inside it, it loads it with new ajaxcontent, like clicking a link inside a frame.

Any ideas?

+1  A: 

You can either

  1. use an iframe inside the fancybox (quickest & easiest, will not use ajax, yet will do as you want and easier SEO), or

  2. put a div inside your fancybox, fill it using ajax and html(), then bind the contained a elements'click event to a function which will do the same again.
    Note that with this second way, you won't automatically have the browser's back button working, SEO's harder, etc.

streetpc
Well, yes that would do the trick, of course. But what I actually was after, which a might have been unsucessfull in explaing, is a way to use the sam transitions and resizing that fancybox uses for the gallery function, but use it for other links aswell. thanks though!
Nils
The resizing for an iframe (or ajax-filled div) imply to know the ideal size for the loaded content. If you control this content (it's on your server along with the contained page so it's not restricted by the same origin policy), you can easily talk between your iframe and the parent window to call the reisizing function with the wanted width/height.
streetpc