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.
How to align image at a center of a block? I tried https://drupal.org/comment/5129366#comment-5129366 but it isn't work. Here is generated code of my field:
it has "float:left" block and some "position:absolute" blocks, so how can i centered it? My images has different width, so i can't use "margin: 0 auto". It there a way to do it? Thanks.
Comment | File | Size | Author |
---|---|---|---|
absolute.png | 21.66 KB | Nikita Petrov |
Comments
Comment #1
andyg5000Changing to a feature request because it'd be nice to specify your settings overrides in the field formatter which I don't believe is currently possible.
In the meantime, you can override the js and include your own settings for the plugin by doing the following:
* Create an imagezoom.js in your theme directory
* Add scripts[] = imagezoom.js
* Write your own selectors and init the plugin on them with your overrides.
* Note, you'll need to make sure you have a selector and elevateZoom() init for everywhere you want the image zoom to happen.
Comment #2
davisbenIn the 7.x-2.x version, there is hook_imagezoom_settings_alter() that allows you to change the settings that are sent to the elevatezoom plugin. I added imagezoom.api.php to document that hook.