2013-01-11 37 views
0

就像編譯成HTML的.jade文件一樣,我也是JQuery Mobile的新手。我正在初始化jQuery Mobile在這個玉文件中是這樣的。Jade + JQuery Mobile,如何添加某種按鈕?

doctype 5 
html 
    head 
    title= title 
    meta(name='viewport', content='width=device-width,initial-scale=1') 
    link(rel='stylesheet', href='/stylesheets/jquery.mobile-1.2.0.min.css') 
    script(type='text/javascript', src='/javascripts/jquery-1.8.2.min.js') 
    script(type='text/javascript', src='/javascripts/jquery.mobile-1.2.0.min.js') 

這是正確的嗎? 還有我將如何改變這樣的事情...

if (elem.onload == 1)             
    input(type = 'checkbox', name = elem.name + '|onl', checked) 
else 
    input(type = 'checkbox', name = elem.name + '|onl') 
| OnLoad 

要東西是使用jQuery Mobile的按鈕。 謝謝!

+0

這裏有什麼問題?爲什麼不那麼正確?運行你的代碼,並嘗試它! – Amberlamps

+0

或多或少,我想知道如何將複選框更改爲某種JQuery Mobile按鈕。我目前無法測試此代碼。 –

回答

0

關於jQuery部分,它工作正常,因爲我只測試了這段代碼,並且在點擊它們時兩個內容都消失了。

!!! 5 
html(lang="en") 
    head 
    title Holamundo! 
    script(type='text/javascript', src='http://code.jquery.com/jquery-1.9.1.js') 
    body 
    h1#headTitle Hello, World 
    p#content This is an example of Jade. 
    script 
     $('#headTitle').click(function() { 
     $(this).hide(); 
     }); 
     $('#content').click(function() { 
     $(this).hide(); 
     }); 
相關問題