Sign in

add attribute to image

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #549
    ajeet

    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.

    <span class="pl-en">mediumZoom</span>(<span class="pl-s"><span class="pl-pds">'</span>[data-zoomable]<span class="pl-pds">'</span></span>)

    Where do I add the attribute ? and How do I add <span class="pl-en">mediumZoom</span>(<span class="pl-s"><span class="pl-pds">'</span>[data-zoomable]<span class="pl-pds">'</span></span>)

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

    <script src="../assets/js/medium-zoom.min.js"></script>

     

    Can you please suggest  ???? Thanks,

     

    Ajeet

    #550
    ajeet

    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
    BobBob
    Support

    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.

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #556
    ajeet

    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
    BobBob
    Support

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

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #577
    ajeet

    Only images in the posts..

    #580
    BobBob
    Support

    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.

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #581
    ajeet

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

     

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘add attribute to image’ is closed to new replies.