[solved]passing custom attribute 'jqimg' from one plugin...
this seems like it should be easy.
I have a page on my site set up as a portfolio with the
http://devkick.com/lab/galleria/Galleria plugin (
http://www.kennethrapp.net/graphicdesign/portfolio-jquery.php). Galleria, as it's set up with its option for custom thumbnails, uses an unordered list with a link to a thumbnail image around a large image. Something like:
-
<LI><a href="(link to thumbnail src)"><img src="(large image)"></a></LI>
I want to extend the functionality of this with the
http://www.mind-projects.it/blog/jqzoom_v10jqzoom plugin. jqzoom requires a custom attribute for a target image, "jqimg", with a url value of a larger image which it writes into a div as a 'zoom' effect.
This is where it gets tricky, though. I can manually add the 'jqimg' values to the images in the ordered list, and jqzoom will work fine if you mouseover the thumbnails. But I want jqzoom to target the large image generated by Galleria after you click the thumbnail. This means I need to transfer the 'jqimg' attribute to that other image, and then activate jqzoom, targeting that image.
As it stands (in Firefox, anyway, I don't even want to know what it does in IE yet) I have jqzoom targeting the correct image, but I cannot seem to actually transfer the attribute. I realize this may be a terribly newb question but I've been beating my head against a wall for nearly two days trying to figure this one out. Here's the code I'm using:
-
$('#main_image div').children('img').attr("jqimg",function(){
$('ul.gallery_demo li.active').children('img').attr("jqimg");
});
I've also tried passing it as a variable. As far as I can tell using Firebug, the variable never has anything but a null value, even though the reference checks out:
-
var jqTransferImg = $('ul.gallery demo li.active').children('img').attr("jqimg");
$('#main_image div').children('img').attr("jqimg",jqTransferImg);
If someone can tell me what I'm doing wrong?