1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 XML Help- Image Map

Discussion in 'Styling and Customization Questions' started by Grizzly Adam, Oct 20, 2014.

  1. Grizzly Adam

    Grizzly Adam Active Member

    I am trying to set up an image map for my gallery so that when I click on the left 100 pixels it will go to the previous images and for the right 100 pixels it will go to next. I have the variables $image.height and $image.width at my disposal and the left side is working just fine.

    The problems comes in on the right side because I can't figure out how to write a simple subtraction statement. I am editing a template, so it should be xml. I just want to be able to use a statement that would be the equivalent of {$image.width}-100. Any ideas?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Have you tried using xen:calc?

    Code:
    {xen:calc '{$image.width} - 100'}
     
  3. Grizzly Adam

    Grizzly Adam Active Member

    That did it. Thanks. Now I'm working on another can of worms-- some of the images have been resized to be smaller and those, of course, cause this to break. So I need to figure out how to get the image width after the image has been resized.
     

Share This Page