0

我有这样的Angular JS代码:

$scope.addAnswerTag = function (event){

    $scope.image_left = $('#questionimage'+$scope.current_question_idx).offset().left;
    $scope.click_left = event.pageX;
    $scope.left_distance = $scope.click_left - $scope.image_left;
    $scope.image_top = $('#questionimage'+$scope.current_question_idx).offset().top;
    $scope.click_top = event.pageY;
    $scope.top_distance = $scope.click_top - $scope.image_top;
    $scope.mapper_width = $('#mapper'+$scope.current_question_idx).width();
    $scope.imagemap_width = $('#questionimage'+$scope.current_question_idx).width();
    $('#elementId').scope();
    $scope.mapper_height = $('#mapper'+$scope.current_question_idx).height();
    $scope.imagemap_height = $('#questionimage'+$scope.current_question_idx).height();
    $scope.quiz_tracker.qns_data[$scope.current_question_idx].left = $scope.left_distance;
    $scope.quiz_tracker.qns_data[$scope.current_question_idx].top = $scope.top_distance;
    $scope.quiz_tracker.qns_data[$scope.current_question_idx].width = "150";
    $scope.quiz_tracker.qns_data[$scope.current_question_idx].height= "150";
    //$('#mapper'+$scope.current_question_idx).draggable("enable");
    $('#mapper'+$scope.current_question_idx).draggable({ containment: "parent" });

    $scope.add_icon[$scope.current_question_idx] = "icon-plus-sign icon-2x";
    if ($scope.add_icon[$scope.current_question_idx] == "icon-plus-sign icon-2x")
    {
        $scope.show_next_buttons = false;  
    }
}

我有这样的html代码,我想从浏览器中的控制器访问视图中的顶部、左侧、高度、宽度

<div ng-hide = "quiz_tracker.qns_data[current_question_idx].width == '0';quiz_tracker.qns_data[current_question_idx].height == '0'" id='mapper{{current_question_idx}}' style="left: {{quiz_tracker.qns_data[current_question_idx].left}}px; top:{{quiz_tracker.qns_data[current_question_idx].top}}px; width:{{quiz_tracker.qns_data[current_question_idx].width}}px; height:{{quiz_tracker.qns_data[current_question_idx].height}}px; border: 5px solid rgb(0, 0, 0); z-index: 1000; position: absolute;" class="{{map_class}}" ><i id= "addtagicon" class = "{{add_icon[current_question_idx]}}" ng-click='saveAddTag()' style = "color:black;"> </i></div>                    

如何在视图中获取范围值,我无法在 ie 10 中获取此视图的样式和类,这在所有其他浏览器中都有效......请帮助我......

我也无法获得这些样式表和类名:

style="left: {{quiz_tracker.qns_data[current_question_idx].left}}px; top:{{quiz_tracker.qns_data[current_question_idx].top}}px; width:{{quiz_tracker.qns_data[current_question_idx].width}}px; height:{{quiz_tracker.qns_data[current_question_idx].height}}px;"
4

0 回答 0