Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #440006 Score: 0
    Profile photo of Mélisande Buitenkamp
    Mélisande Buitenkamp
    Member
    beginner
    intermediate
    curious george
    picture perfect
    wise owl
    @mbuitenkamp.4316

    Hey all,

    Trying to get an awesome script to work, I found this thread with an example of a magnifying glass.
    However, it only works in preview mode, as soon as I publish,

    Would anyone be able/willing to help me out?

    Here’s the example: Magnifying Glass example

    #440432 Score: 1
    Profile photo of Robert Aung-Naing
    Robert Aung-Naing
    Member
    beginner
    intermediate
    friend finder
    profile
    wise owl
    contributor
    18 pts
    @raungnaing

    Here is an updated version that should work with the current version of Lectora.

    This post has received 1 vote up.
    Attachments:
    1. magnify.zip
    #440489 Score: 0
    Profile photo of Mélisande Buitenkamp
    Mélisande Buitenkamp
    Member
    beginner
    intermediate
    curious george
    picture perfect
    wise owl
    @mbuitenkamp.4316

    awesome!!!

    could you (try to) explain what’s different, why does this work when the older version doesn’t?

    #440563 Score: 0
    Profile photo of Robert Aung-Naing
    Robert Aung-Naing
    Member
    beginner
    intermediate
    friend finder
    profile
    wise owl
    contributor
    18 pts
    @raungnaing

    Well, there are a few issues with the old script.

    • When trying to get the width and height of the original (full size) image, it needs to wait until the file finished loading. The comment indicates that it needs to wrap in .load but it actually doesn’t do it. So the image size is not set and calculations do not work.
    • jQuery selectors (.small, .large, etc) do not work partly due to the upgrade in Lectora for seamless play publish.
    • The magnifier (the div and full size image) does not show up due to layering (need to set z-index).
    • I also added loadPending flag to avoid duplicate loading of the full size image.

    If you want to change the size of the magnifying glass you can update the magnifierSize variable in magnify.js. I got rid of the css and moved the style to the js file so you only have to add one file.

    #440565 Score: 0
    Profile photo of Mélisande Buitenkamp
    Mélisande Buitenkamp
    Member
    beginner
    intermediate
    curious george
    picture perfect
    wise owl
    @mbuitenkamp.4316

    thank you so much!

    It works like a gem, and I actually understand your explanation 😉

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.