people are having mixed results - mostly good, but a couple of misses - with the setup described here:
http://jsplumbtoolkit.com/doc/zooming
i actually just realised there's a big typo in the code that shows you how to set the transform via css, but if you go here:
http://jsplumbtoolkit.com/flowchart/jquery.html
and put this into the console:
var setZoom = function(z, el) {
var p = [ "-webkit-", "-moz-", "-ms-", "-o-", "" ],
s = "scale(" + z + ")";
for (var i = 0; i < p.length; i++)
el.css(p[i] + "transform", s);
jsPlumb.setZoom(z);
};
then
jsPlumb.setZoom(0.75, $("#main"));
you should see it working. you can also drag new connections with it zoomed too.
--
You received this message because you are subscribed to the Google Groups "jsPlumb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsplumb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Glad you got it working!I don't think this is something you're concerned with, but for anyone else who's watching this topic or comes across it, I am messing around with a way to support zoom in IE8 too, using the Matrix filter. I will update the docs and the group threads when I have it sorted.
--
var setZoom = function(z, el) {
var p = [ "-webkit-", "-moz-", "-ms-", "-o-", "" ],
s = "scale(" + z + ")";
for (var i = 0; i < p.length; i++)
el.css(p[i] + "transform", s);
jsPlumb.setZoom(z);
};then
jsPlumb.setZoom(0.75, $("#main"));
What do you mean when you say "I started moving the entire zoomed-in diagram" ? With the code I pasted I don't see any jumping on drag of the sort that people are talking about there.
--
actually that code i pasted is wrong - the second bit should be just
setZoom(0.75, $("#main"));
without jsPlumb. in front of it.
btw you shouldn't use relative positioning with draggable elements. jQuery UI writes left and top styles on the elements. when an element is positioned relative these values are interpreted to be offsets from the element‘s “normal” position, which is calculated by the page flow. they are not relative to the 0,0 point of the node’s first relatively positioned ancestor.
--
yes, #main has position relative, that's correct. An absolutely positioned div is positioned with respect to the 0,0 point of the first of its ancestors that is explicitly positioned relative. All of the window divs are positioned absolute and are children of #main, and #main is setup as the jsPlumb container, so everything is a child of that div and it all hangs together.
yes,
#mainhas position relative, that's correct. An absolutely positioned div is positioned with respect to the 0,0 point of the first of its ancestors that is explicitly positioned relative. All of the window divs are positioned absolute and are children of#main, and#mainis setup as the jsPlumb container, so everything is a child of that div and it all hangs together.
--
yes, you set relative on the parent. that's it. i think perhaps i need to make the documentation a little more clear!
--
--
The "no dependency" version of jsPlumb is 1.6.0 +...what do you mean when you say you are using 1.4.1?
--
You received this message because you are subscribed to the Google Groups "jsPlumb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsplumb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.