jmpressjs / jmpress.js

A jQuery plugin to build a website on the infinite canvas
http://jmpressjs.github.com/jmpress.js
1.5k stars 237 forks source link

img scaling issue #64

Closed deepdiev closed 12 years ago

deepdiev commented 12 years ago

I'd like to use this website for my example: http://tympanus.net/Tutorials/SlideshowJmpress/

I'm doing something similar to this style and was wondering if there was a way to set the scaling inside the html/php document?

If you view the source, you'll notice that the first child of the div.jms-wrapper contains styles that scale the X and Y values by 0.742 instead of 1. Once you disable it, the picture and text may overflow from the view box. But that's how you know the scaling is being applied. But let's say I don't want to constrain the scaling to less than 1. Is there a way to set it to 1? It's scaling all my images to a value less than 1 and it's really frustrating me.

Thanks in advanced!

sokra commented 12 years ago

The content of the .jms-wrapper is scaled to fit into the container. 0.742 is a value calculated by jmpress which depends on your window size.

The author do this in http://tympanus.net/Tutorials/SlideshowJmpress/js/jquery.jmslideshow.js with this lines:

        viewPort        : {
            height  : 400,
            width   : 1000,
            maxScale: 1
        },

If you omit this (or override it) content is no longer scaled, but than may no longer fit into the container. The container in the example is responsive to the window size, if your container isn't you do not need viewPort.

sokra commented 12 years ago

http://shama.github.com/jmpress.js/docs/#docs-viewport

deepdiev commented 12 years ago

Thank you! I set the maxScale to minScale and problem solved!