Search Results

Search found 2 results on 1 pages for 'jointjs'.

Page 1/1 | 1 

  • Prevent dragging in Joint JS

    - by user3607705
    I am working on JointJS API. However I want to prevent the elements from being movable from their original positions. Can you suggest me some feature of JointJS or any feature of CSS in general, which I could use to make my object immovable. I can't use interactive: false option on the paper or paper.$el.css('pointer-events', 'none'); because I need to have highlighting features when mouse hovers over the element. Please suggest a way that disables movement of elements while allowing other features.

    Read the article

  • How to add an onclick event to a joint.js element?

    - by ahalbert
    I have a joint.js element in a DAG, and would like to be able to trigger an event by clicking on it. I could use $(selector).click(...) to do it, but I was wondering if there was a joint.js specific way of handling it, since that would probobly be better. One event I decided was a candidate for onclick was 'batch:stop' My code: var variable = new joint.shapes.basic.Rect({ name : label, id: label, onclick : function () {alert("hello");}, size: { width: width, height: height }, attrs: { text: { text: label, 'font-size': letterSize, 'font-family': 'monospace' }, rect: { fill : fillColor, width: width, height: height, rx: 5, ry: 5, stroke: '#555' } } }); variable.on('batch:stop', function (element) {alert(""); toggleEvidence(element.name);}); return variable; How should I add an onclick event?

    Read the article

1