Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.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
我想在jquery中使用switch case在单击按钮时将布局从一个地方移动到另一个地方。这是我的密码_Jquery_Html_Css - Fatal编程技术网

我想在jquery中使用switch case在单击按钮时将布局从一个地方移动到另一个地方。这是我的密码

我想在jquery中使用switch case在单击按钮时将布局从一个地方移动到另一个地方。这是我的密码,jquery,html,css,Jquery,Html,Css,我想做一个切换案例,并根据jquery中的按钮移动对象 $("input[type='button']").click(function(){ switch(this.id){ case 'moveright': $(".layout3").css({left:"735px"}); break; case 'movebottom': $(".layout3").css({top:

我想做一个切换案例,并根据jquery中的按钮移动对象

 $("input[type='button']").click(function(){
     switch(this.id){
         case 'moveright':
             $(".layout3").css({left:"735px"});
         break;
         case 'movebottom':
             $(".layout3").css({top: "850px"});
             break;
     }
 });
这是我的
''

试试这个

$("input[type='button']").click(function(){
     switch(this.id){
     case 'moveright':
        $(".layout3").css({"margin-left":"735px"});
        break;
     case 'movebottom':
         $(".layout3").css({"margin-top": "850px"});
        break;
     }
});

@瓦隆:在这里分享你的html代码。。下面的JSFIDLE链接中的htmlits der可能存在一些问题