Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

add attribute to image

  • #549
    Avatar photo[anonymous]

    Hi,

    I am trying to use a <span class=”text-gray-dark mr-2″>JavaScript library for zooming images</span>. In the documentation, it says to add the `data-zoomable` attribute to  images, and then use this.
    `mediumZoom([data-zoomable])`
    Where do I add the attribute ? and How do I add `mediumZoom([data-zoomable])`

    I have already imported the library using Custom HTML tool in the app

    ` `

    Can you please suggest  ???? Thanks,

    Ajeet

    #550
    Avatar photo[anonymous]

    When I post something using the current editor in this forum, the view gets distorted as you can see above.

    But while editing, it does not show like this

    error

    For example, I did not add <span class=”text-gray-dark mr-2…

    but it somehow got added automatically once I submitted the post ?

    Does anyone know why is this happening ?

    #555
    Avatar photoBob

    Hi Ajeet,

    It works for me very well: mediumZoom(‘[data-zoomable]’).
    Probably you are pasting a dirty piece of code (html) instead of plain text.

    #556
    Avatar photo[anonymous]

    Hi Bob,

    Thanks. I have just copied some code like this `data-zoomable` from github and pasted in the editor. In ticksy, I used to do this, but in here, the WP editor has some issues, I think.

    Reposting the query, if you could help me on that. I am using a js library . Its doc says I need to add `data-zoomable` attribute to images, and then use this code:

    `mediumZoom(‘[data-zoomable]’)`

    zoom

    How do I add the attribute ?

    #576
    Avatar photoBob

    Do you want to add it to the featured image or to the images into a post?

    #577
    Avatar photo[anonymous]

    Only images in the posts..

    #580
    Avatar photoBob

    It requires a new helper, so I need to direct you to our new customization service https://getpublii.com/customization-service/

    You can also try to edit the file helpers.js on your own.

    #581
    Avatar photo[anonymous]

    Thanks. I did not know about the helper.js file . I will do