jQuery Barcode Dynamic Options

To change any of the widget options dynamically you need to get the initial options, change the desired properties and call the widget refresh(options) method, passing the new values.
This is demonstrated in the code below:


$("#code11").shieldBarcode({
    type: "CODE-11",
    value: "123-45",
    width: 300,
    height: 200,
    style: {
        background: "#e3e3e3",
        borderColor: "black",
        borderStyle: "dashed",
        borderWidth: 2,
        color: "green",
        paddingTop: 50,
        paddingBottom: 50,
        paddingLeft: 100,
        paddingRight: 100
    }
});

function changeOptions() {
    var barcode = $("#code11").swidget(),
    options = barcode.initialOptions;
    options.width = 700;
    barcode.refresh(options);
}