2009-06-03 15 views
5

Estoy tratando de usar jQuery PrettyPhoto y por alguna razón no está pasando por la variable id ... si alguien ha encontrado este problema antes y conoce una solución, ¡sería fantástico! Aquí está el código:jQuery PrettyPhoto pasando ID a iframe

<a href="/store-item-details?id=5&iframe=true&width=800&height=530" 
    rel="prettyPhoto[iframes]" 
    title=""> 
    <img src="/images/store/thumbs/'.$item->image.'" 
     alt="'.$item->name.'" 
     width="100" 
     border="0" /> 
</a> 

Aquí está el enlace (con bastante foto, haga clic en una de las miniaturas)

http://www.photographicpassions.com/shop?view=products&category=1

y aquí está el enlace directo de la etiqueta:

http://www.photographicpassions.com/store-item-details?id=1&iframe=true&width=800&height=530

Por favor ayuda! :)

Respuesta

6

Tu problema está en prettyPhoto. El complemento asume (en el caso de iframe) que no hay otros parámetros importantes en esa url y los elimina después de analizar el alto y el ancho.

Aquí hay un fragmento de la versión no actualizada de jquery.prettyPhoto.js. Observe la tercera línea, donde borra todo después del questionmark en movie_url.

}else if(pp_type == 'iframe'){ 
     movie_url = $caller.attr('href'); 
     movie_url = movie_url.substr(0,movie_url.indexOf('?')); 

     pp_typeMarkup = '<iframe src ="'+movie_url+'" width="'+(correctSizes['width']-10)+'" height="'+(correctSizes['height']-10)+'" frameborder="no"></iframe>'; 
    } 

No estoy seguro de cómo se siente intrépido pero si comentar que la tercera línea que va a trabajar para usted. (Es probable que desee volver a ver después Minify: http://fmarcia.info/jsmin/test.html)

}else if(pp_type == 'iframe'){ 
     movie_url = $caller.attr('href'); 
     // movie_url = movie_url.substr(0,movie_url.indexOf('?')); // commented out to allow other attributes to be passed along. 

     pp_typeMarkup = '<iframe src ="'+movie_url+'" width="'+(correctSizes['width']-10)+'" height="'+(correctSizes['height']-10)+'" frameborder="no"></iframe>'; 
    }