yunap / traceit

jQuery plugin based on raphael.js that lets you dynamically trace page elements. Now also available as AngularJs directive:
https://github.com/yunap/angular-traceit
72 stars 5 forks source link

Clean up code examples in README.md? #5

Closed ghost closed 10 years ago

ghost commented 10 years ago

Sync it to actual code, and fix code formatting. Just for looks!

yunap commented 10 years ago

done. should probably do the same for demo page at: http://valleybazaar.org/#tracebox as well as example page https://github.com/yunap/traceit/blob/master/examples/index.html

ghost commented 10 years ago

Check the indents in a code block after "The trace constructor accepts the following traceOpt options object."

yunap commented 10 years ago

hmm, in "#example2"? it is an output of http://jsbeautifier.org/

ghost commented 10 years ago

Like this (too lazy for pull request):

$('#example2').trace({
    traceOpt: {
        traceCanvasPadding: 10,
        redrawSpeed: 3500,
        traceDivPref: "_wrap",
        traceCursor: 'pointer',
        traceOpt: {
            'stroke': 'yellow',
            'stroke-width': 5,
            'stroke-opacity': 1,
            'fill': 'none',
            'fill-opacity': 0,
            'zindex': 9999
        },
        isVisible: true,
        // will position relative to the document by default
        useRelativePositioning: false, 
        onHide: function () {
            console.log("onHide callback was invoked.")
        },
        onEndTrace: function () {
            console.log("onEndTrace callback was invoked.")
        },
        onClick: function (me) {
            me.options.shape.animate({
                opacity: 0
            }, 1000, function () {
                me.hideTrace();
            });
        }
    }
);