开发者

Image thumbnails as links

开发者 https://www.devze.com 2022-12-29 14:17 出处:网络
im building a w开发者_Python百科ebshop in Drupal and i was wondering if you could help me with the following problem:

im building a w开发者_Python百科ebshop in Drupal and i was wondering if you could help me with the following problem:

I got one big image frame (500x500) and 5 little image thumbnails(95x95) underneath the big one.

How can i realise that if the visitor clicks on the thumbnail, the big image frame gets filled with that specific image?


jQuery is the right direction, but the strength of Drupal is based on doing things "the drupal way", which means, I guess in your case, to use Views as the origin for the thumbnails using imagecache + lightbox, and somehow change the main "frame".

I used jcarousel in some cases (for different but similar uses) and it works nice. I guess it is possible to trick it to do what you need, or - better - to find an existing module that do what you want.

I know, many Drupal buzzwords, and a stiff curve to overcome, but this is the right direction in case you want to base your site on Drupal.

If you don't need all of these, and want a static page+jquery, Drupal might be an overkill altogether.


If you use Views, Imagecache, and the Lightbox2 module, you can create image galleries out the arse and tell it to link the field to its large size and use Lightbox2 as the method. This is how I do most of my galleries.


Drupal uses jQuery so you can write a simple jQuery script to handle this (not sure if there's already a plugin to do that). Just add all the img tags (make sure all of them except the first one are hidden[display=none]). Then when a thumbnail is clicked/hovered do a $(big_img_holder).replace() with the tag for the image to be shown. Tell me if you want to see some code and I'll try to show you.

You can see this plugin as an exapmle. Just replace the numbers on the right with thumbnails and you're ready to go ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消