Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/374.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript KineticJ移动或删除层中的圆_Javascript_Kineticjs - Fatal编程技术网

Javascript KineticJ移动或删除层中的圆

Javascript KineticJ移动或删除层中的圆,javascript,kineticjs,Javascript,Kineticjs,我希望有人能帮我做这件事 我是JS新手,所以我仍然缺乏很多理解。但这个简单代码的问题是,我只希望层中有一个圆可见 如何根据列表中的坐标移动圆 <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"> $(document).one('mobileinit', function () { // Setting #container div as a

我希望有人能帮我做这件事

我是JS新手,所以我仍然缺乏很多理解。但这个简单代码的问题是,我只希望层中有一个圆可见

如何根据列表中的坐标移动圆

   <script type="text/javascript"  src="http://code.jquery.com/jquery-1.8.2.min.js">
    $(document).one('mobileinit', function () {

        // Setting #container div as a jqm pageContainer
        $.mobile.pageContainer = $('#container');

        // Setting default page transition to slide
        $.mobile.defaultPageTransition = 'slide';

        $('#data-role ul').on('click', function () {
            alert($(this).html());
        });
    });

</script>

<script  type="text/javascript" >
    function placering(x, y) {
        alert(x + " UPS  " + y);
    }
</script>
挑选 A. B C
太好了-非常感谢你。我不会告诉你,我在这个问题上花了多少时间,那太尴尬了;做一个傻瓜从来都不尴尬。别忘了接受并投票选出帮助你解决问题的答案和问题:再次感谢。我已经接受了,但是,看起来我不能投赞成票,因为我是这个网站的新成员。我已经用了很多次来解决我的问题。请纠正我,如果我的投票错误。谢谢&是的,确实有一个新用户的限制。请参见此处:。通过向上投票帮助你获得了一些分数,从而超越了初学者的门槛:啊,你真好。事实上,在这个网站上保持如此高的标准给我留下了深刻的印象。到目前为止,我还没有在许多网站上看到过任何常见的可笑的东西:
<script>

    var stage = new Kinetic.Stage({
        container: 'topContainer',
        width: 320,
        height: 800
    });

    var layerPlacering = new Kinetic.Layer();


    function spotOn(x1, y1) {
        var moedeSted = new Kinetic.Circle({
            x: x1,
            y: y1,
            radius: 10,
            fill: 'red',
            stroke: 'black',
            strokeWidth: 0
        });

        layerPlacering.add(moedeSted);
        stage.add(layerPlacering);
    }
</script>

<script type="text/javascript">
    $('#liste').on('click', 'li', function () {
        layerPlacering.clear();
        var test1 = $(this).attr('val1');
        var test2 = $(this).attr('val2');

        spotOn(test1, test2)
    });
</script>
<script>

    var stage = new Kinetic.Stage({
        container: 'topContainer',
        width: 320,
        height: 800
    });

    var layerPlacering = new Kinetic.Layer();

    // remove the function    
    var moedeSted = new Kinetic.Circle({
            x: 0,
            y: 0,
            radius: 10,
            fill: 'red',
            stroke: 'black',
            strokeWidth: 0
        });
        moedeSted.hide(); // just hide it to start with since you do not know the position where to show    
        layerPlacering.add(moedeSted);
        stage.add(layerPlacering);
</script>

<script type="text/javascript">
    $('#liste').on('click', 'li', function () {
        layerPlacering.clear();
        var test1 = $(this).attr('val1');
        var test2 = $(this).attr('val2');

        moedeSted.setPosition(test1, test2); // <---- Change here
        moedeSted.show(); // if this is the first call, it will make the hidden ring visible, no change otherwise
        layerPlacering.draw();
    });
</script>