【问题标题】:HTML5 Mobile Boilerplate Coffeescript Calls [closed]HTML5 移动样板 Coffeescript 调用 [关闭]
【发布时间】:2013-02-18 18:12:53
【问题描述】:

如何在 Coffeescript 中编写这些 JS 调用?

iPhone 缩放错误修复

MBP.scaleFix();

隐藏网址栏

MBP.hideUrlBar();

快速按钮(仅当您只针对 webkit 浏览器时才使用此按钮,我们仍在测试跨浏览器支持)

new MBP.fastButton(document.getElementById('myBtn'), function() {alert("clicked")});

自动增长文本区域

new MBP.autogrow(document.getElementById('myTextarea'), 14); // 14 -- line height

https://github.com/h5bp/mobile-boilerplate/wiki/JavaScript-Helper

【问题讨论】:

    标签: javascript coffeescript html5boilerplate


    【解决方案1】:

    它们大多保持不变。

    iPhone 缩放错误修复

    MBP.scaleFix()
    

    隐藏网址栏

    MBP.hideUrlBar()
    

    快速按钮

    new MBP.fastButton document.getElementById('myBtn'), -> alert "clicked"
    

    自动增长文本区域

    new MBP.autogrow document.getElementById('myTextarea'), 14 
    

    【讨论】:

    • 您确定 autogrow textarea 末尾的括号正确吗?
    • 自己试试吧。为了清楚起见,我添加了它以明确 myTextarea 是 getElementById 的参数,而 14 是 autogrow 的参数。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-29
    相关资源
    最近更新 更多