0
Welcome Guest! Login
0 items Join Now

Rokzoom in AJAX content

    • Mike Feng's Avatar
    • Mike Feng
    • Sr. Rocketeer
    • Posts: 197
    • Thanks: 1

    Rokzoom in AJAX content

    Posted 17 years 2 months ago
    • Hi
      I'm trying to run rokzoom through a page that's loaded dynamically through AJAX. If I run the same page manually (not through AJAX), rokzoom works fine (meaning all the necessary scripts and css were loaded properly. No errors there.). If I load it through AJAX, rokzoom fail to work.

      There is a similar problem with thickbox. A normal thickbox link in an AJAX loaded content will not work, but there is a solution. Consider this normal thickbox link:
      <a class="thickbox" href="http://www.domain.com/page.php?height=200&width=100" title="hello">click</a>
      This will work on normal pages, but will not work if it is loaded dynamically (AJAX). The solution is to call javascript directly:
      <a href="javascript&#058;tb_show('hello','http://www.domain.com/page.php?height=200&width=100','');" title="hello">click</a>

      I've looked through the rokzoom.js src (posted on another thread), but can't seem to find the javascript function that initializes and opens a rokzoom window. Does anyone knows anything about this?

      Regards
    • My extensions: http://www.simbunch.com/
      http://twitter.com/simbunch
    • Mike Feng's Avatar
    • Mike Feng
    • Sr. Rocketeer
    • Posts: 197
    • Thanks: 1

    Re: Rokzoom in AJAX content

    Posted 17 years 2 months ago
    • Since RokZoom is a derivative of slimbox, I thought I'd add slimbox's solution to this problem:
      <a href="javascript&#058;Lightbox.show('http://www.domain.comimages/image_thumb.jpg', 'hello');">
      <img src="http://www.domain.comimages/image.jpg" />
      </a>

      I've tried replacing "Lightbox" with "RokZoom" but it doesn't work. Firebug gives the following error:
      Note I'm using the full source of rokzoom in this example.
    • My extensions: http://www.simbunch.com/
      http://twitter.com/simbunch
    • Mike Feng's Avatar
    • Mike Feng
    • Sr. Rocketeer
    • Posts: 197
    • Thanks: 1

    Re: Rokzoom in AJAX content

    Posted 17 years 2 months ago

Time to create page: 0.051 seconds