javascript - 输入时改变形式

标签 javascript css html

表单将有两个输入,“发件人:”和“收件人:”位置。在用户输入这些值后,我将使用 Google Maps API v3 计算距离并创建价格,但是我希望表格转换为新的(更大的)表格并显示结果(即价格、通行费、销售税) .我将如何创建一个根据用户输入而变化的动态表单?

最佳答案

参见 http://jsfiddle.net/Lhebc8u8/

在按钮点击时添加一个类并在 css 中添加过渡

$("#btn").click(function(){ $("div").addClass("classLarge"); });

.classSmall 
{
    width: 100px; 
    transition: width 2s; 
    border-style: solid;
    border-width: 5px;
} 

.classLarge {width:200px;} 

关于javascript - 输入时改变形式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26193973/

相关文章:

javascript - 如何使用 CSS 缩小另一个 div 中的 div?

javascript - window.onresize 在 iPad 上连续调用

html - Google 字体无法在我的网站上使用

javascript - 字符串在附加时被解释为 HTML 标记

javascript - 当存在多个选择框时,jquery select2 选项冲突

javascript - 比较在 Coffeescript/Javascript 和 Ruby 中给出了不同的结果

javascript - 替换图像 src onclick jQuery

html - 输入文本前的行

javascript - 加载位于根目录之外的 json 和图像

css - 在滚动 div 中时,背景附件固定在 chrome 中不起作用