Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Is there a way to make this happen:
Clicking on one image that will leads to the display of the next one? Thanks.
Hang
Comments
Comment #1
foredoc CreditAttribution: foredoc commentedIt will be great, if the next/previous functionality will be integrated with the mouse/pointer position on the currently browsed image.
For example, if the mouse is clicked on the left part of the image, then the image will be replaced by the previous one; if the mouse is clicked on the right part of the image, then the image will be replaced by the next one.
Any ideas how to make this happen? Thanks.
Comment #2
scroogie CreditAttribution: scroogie commentedThe original functionality (click for next image) can be enabled by choosing the correct display formatter on the "Display fields" page of CCK for your image content type. If you have the advanced_help module activated, there should be a help text describing that on /admin/advanced_help/node_gallery
Implementing image areas like suggested in the first comment can be done by implementing an additional formatter. See node_gallery_field_formatter_info() in node_gallery.module and theme_node_gallery_formatter_nextimagelink in theme.inc for examples.
Comment #3
foredoc CreditAttribution: foredoc commentedThanks. I will take a look.
Comment #4
foredoc CreditAttribution: foredoc commentedHi,
I checked node_gallery_field_formatter_info(), and theme_node_gallery_formatter_nextimagelink. It is easy to understand how "click"=>"next" logic is achieved. However, I am still not sure how to encode the logic like:
"click left part of image"=> prevous image
"click right part of image" => next image
Do I have to use jQuery for this purpose?
Thanks.
Comment #5
scroogie CreditAttribution: scroogie commentedThere are different ways to achieve this. You can e.g. define HTML areas on the image, either with jQuery or statically. Or you could use the image through CSS background and create two linked divs in front of it. Or you could directly track the mouse position by X and Y coordinates with jQuery.
Comment #6
scroogie CreditAttribution: scroogie commentedThis might be a feature for a future version, or even for an additional module that implements display formatters.
Comment #7
justintime CreditAttribution: justintime commentedupdating title
Comment #8
Prodigy CreditAttribution: Prodigy commentedYou could also implement something similar by displaying prev and next arrows to the left(prev) and right(next) of the image.
A 'dirty' way would be to modify the image navigator template and turn the previous and next text links into images.
Just use CSS to position them absolutely, relative to the image or another div.
Comment #9
zengenuity CreditAttribution: zengenuity commentedAt this point, I won't be adding new features to the D6 version. If features are wanted for D7, please post a new issue.