@sree1 wrote:
I’m trying to blink the picture from green to red and red to green.
my code is:$(go.Node, "Auto", $(go.Shape, "Rectangle", new go.Binding("stroke", "highlight", function(v) { return v ? "green" : "red"; }), new go.Binding("strokeWidth", "highlight", function(v) { return v ? 3 : 1; })), $(go.Picture, { maxSize: new go.Size(100, 100) }, new go.Binding("source", "geo")), $(go.TextBlock, { margin: 5, editable: true, alignment: go.Spot.Bottom, font:"bold 11pt Arial", stroke: "#446700" }, new go.Binding("text","text")) ));
function flash() { myDiagram.model.commit(function(m) { var data = m.nodeDataArray[0]; m.model.set(data, "highlight",!data.highlight)},"flash"), function loop() { setTimeout(function() { flash(); loop(); }, 500); } loop(); }
Posts: 6
Participants: 3