Skip to content

Instantly share code, notes, and snippets.

@totem3
Created December 16, 2011 15:03
Show Gist options
  • Save totem3/1486380 to your computer and use it in GitHub Desktop.
Save totem3/1486380 to your computer and use it in GitHub Desktop.
CSS Selector便利。。
<lift:surround with="default" at="content">
<lift:CssSelectorTest.selector>
<div id="button" />
<div class="text" />
<div name="input" />
<div class="text2" />
<span>spanですよ。 </span><br/>
<button>ボタン!</button>
</lift:CssSelectorTest.selector>
</lift:surround>
class CssSelectorTest {
val alert = Run("alert('まじかよ!')")
val unitToAlert = () => alert
val strToAlert = (s:String) => alert
def selector = {
".text" #> <p>文字列でも?</p> &
"#button" #> ajaxButton("ボタンも置けるの?", unitToAlert) &
"@input" #> ajaxText("これも??", (s:String) => alert) &
".text2 *+" #> "置き換わっちゃうのもこうすれば!!" &
"button" #> "元ボタンです" &
"span *+" #> "Lift Cool! Awesome!!"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment