2017-10-12 73 views
-8

我是JavaScript新手,我有我的注册和登录屏幕设置我希望它滑动,当用户点击注册或登录,但我的index.js给我错误的任何方式来解决这个问题,或者我执行它错了? Login screenJavascript错误屏幕

my error

+2

首先尝试用裸手,第二次发布您的错误,当你**尝试**做一些编码 –

回答

-1

如果您正在使用jQuery,那么你可以添加类/ ID.slideToggle(),这将这样的伎俩

与尝试参考以下网址:w3schools.com/jquery/tryit.asp?filename=tryjquery_animation1

<!DOCTYPE html> 
<html> 
    <head> 
    <script src="ajax.googleapis.com/ajax/libs/jquery/3.2.1/…; 
    <script> 
     $(document).ready(function(){ 
     $("button").click(function(){ 
      $("div").animate({left: '250px'}); 
     }); 
     }); 
    </script> 
    </head> 

    <body> 
    <button>Start Animation</button> 
    <div style="background:#98bf21;height:100px;width:100px;position:‌​absolute;"></div> 
    </body> 
</html> 
+0

如何添加JQuery? –

+0

尝试以下 参考网址:https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_animation1 <!DOCTYPE HTML!>

vic

+1

@vic您的评论应该是你的答案的编辑。 – haindl

0

<!DOCTYPE html> 
 
<html> 
 

 
<head> 
 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
 
    <script> 
 
    $(document).ready(function() { 
 
     $("button").click(function() { 
 
     $("div").animate({ 
 
      left: '250px' 
 
     }); 
 
     }); 
 
    }); 
 
    </script> 
 
</head> 
 

 
<body> 
 

 
    <button>Start Animation</button> 
 

 
    <p>By default, all HTML elements have a static position, and cannot be moved. To manipulate the position, remember to first set the CSS position property of the element to relative, fixed, or absolute!</p> 
 

 
    <div style="background:#98bf21;height:100px;width:100px;position:absolute;"></div> 
 

 
</body> 
 

 
</html>