relative positionning

75 views
Skip to first unread message

christop...@liafa.univ-paris-diderot.fr

unread,
Nov 27, 2013, 11:47:23 AM11/27/13
to jmpr...@googlegroups.com
Hi Tobias and all,

I'm looking for a way to refer to the properties (x,y,z,scale) of the previous slide, so i can easily move bunches of slides without breaking the whole show.

Templates are a great feature to achieve this but i've only seen examples where the coordinates depend on idx (which i figured out to be the number of the step), like

            x: -300 + idx * 300

in the template doc page.

But i don't want my slideshows to be *that* regular :)
I'm looking for something like

            x: x+300  // ?

assuming x and other properties are initialized with the previous slide's.
But i guess neither this assumption nor this syntax are valid.
There must be a way (perhaps even not a hack) to do that.

A modest but much usefull impress.js fork does that:
with the following syntax:
            <div class="step" data-x"+=300">
(all properties being initialized with the previous slide's)
It *is* a hack, but it does the job.
It's what i currently use, but it won't likely be pulled into impress.js (and anyway i want to switch to jmpress for many reasons).


Tobias Koppers

unread,
Nov 27, 2013, 1:12:36 PM11/27/13
to jmpress.js
Here is a example how to do this: 


It's only for X dimension, but the will get the idea.

--
You received this message because you are subscribed to the Google Groups "jmpress.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jmpressjs+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

christop...@liafa.univ-paris-diderot.fr

unread,
Nov 27, 2013, 4:57:54 PM11/27/13
to jmpr...@googlegroups.com, tobias....@googlemail.com



OK, great, thanks Tobias, and for the introduction to the initStep hook.

    initStep: function( step, eventData ) {
        var data = eventData.data;
        var stepData = eventData.stepData;
        if(data.relX) {
            stepData.x = step.prev().data("stepData").x + parseFloat(data.relX);
        }
    }

Now i guess i can forge a unique data attribute, say data-rel, and check for this attribute on the slide: if it is set, then i iterate on all coordinates the way you did on x to initialize them.

Cheers.
 

Miklos Emri

unread,
Jan 5, 2014, 2:24:30 PM1/5/14
to jmpr...@googlegroups.com, tobias....@googlemail.com
Hi Tobia,

I am going to create some jmpress based presentation (for education and research), but I just now learn the application of html, css and java scripting.
Could you please help me how can I use the suggested solution ( http://jsfiddle.net/5dQr4/ ) to enable me to use data-rel-x in a <div>  section?

Thanks
Miklos
Reply all
Reply to author
Forward
0 new messages