阅读背景:

从函数外部调用更改变量

来源:互联网 
var slider = document.getElementById('test5');
noUiSlider.create(slider, {
    start: [1366],
    step: 1,
    range: {
        'min': 200,
        'max': 1920
    },
    format: wNumb({
        decimals: 0,
        postfix: 'px',
    })
});

var app = angular.module('myApp', []);

app.controller('myWidth', function ($scope) {
    $scope.width = inputFormat.value;

    $scope.$watch('width', function (newValue, oldValue) {
        console.log('Old:' + oldValue);
        console.log('New:' + newValue);
    });
    console.log($scope.width + ' - scope width');
});
var inputFormat = document.getElementById('input-format');
editorContainer = document.getElementById('editorContainer');
slider.noUiSlider.on('update', function (values, handle) {
    inputFormat.value = values[handle];
    //$(editorContainer).css('width', values[handle]);
});
inputFormat.addEventListener('change', function(){
    slider.noUiSlider.set(this.value);
});
var slider = document.getElementById('test5');



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: