Magnifying glass for images

mbuitenkamp-4316
mbuitenkamp-4316 Community Member Posts: 12
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

Comments

  • raungnaing
    raungnaing Community Member Posts: 35
    Here is an updated version that should work with the current version of Lectora.
  • mbuitenkamp-4316
    mbuitenkamp-4316 Community Member Posts: 12
    awesome!!!

    could you (try to) explain what's different, why does this work when the older version doesn't?
  • raungnaing
    raungnaing Community Member Posts: 35
    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.
  • mbuitenkamp-4316
    mbuitenkamp-4316 Community Member Posts: 12
    thank you so much!

    It works like a gem, and I actually understand your explanation ;)
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!