Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Static types for the jQuery API for Scala.js programs.

License

NotificationsYou must be signed in to change notification settings

UdashFramework/scala-js-jquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CIMaven CentralJoin the chat at https://gitter.im/UdashFramework/scala-js-jquery

Static types for the jQuery API forScala.js programs.

Usage

Add the following dependency to your SBT build:

libraryDependencies+="io.udash"%%%"udash-jquery"%"3.3.0"

then import the jQuery package:

importio.udash.wrappers.jquery._

Since version3.0.4 the wrapper targets SJS 1.x series and supports JS dependencies managed bybyscalajs-bundler orsbt-jsdependencies

Examples

importio.udash.wrappers.jquery._jQ("#elementId")  .hide(AnimationOptions(    duration=Some(3000),    easing=Some(EasingFunction.linear)  ))  .show(1500,EasingFunction.swing)
importio.udash.wrappers.jquery._valelement:JQuery= jQ("#id")element.text("Text content")element.attr("example-attr","value")element.attr("example-attr")match {caseSome(value)=> println(s"Attribute value:$value")caseNone=> println("Attribute not found!")}
importio.udash.wrappers.jquery._valcallbacks= jQ.callbacks[js.Function1[(Int,Int), js.Any], (Int,Int)]()callbacks.add((t: (Int,Int))=> {val (a, b)= t  jQ("#plus").append(li(s"$a +$b =${a+b}").render)})callbacks.add((t: (Int,Int))=> {val (a, b)= t  jQ("#minus").append(li(s"$a -$b =${a-b}").render)})callbacks.add((t: (Int,Int))=> {val (a, b)= t  jQ("#mul").append(li(s"$a *$b =${a*b}").render)})callbacks.add((t: (Int,Int))=> {val (a, b)= t  jQ("#div").append(li(s"$a /$b =${a/b}").render)})callbacks.fire(1,1)callbacks.fire(3,3)callbacks.fire(7,4)callbacks.disable()callbacks.fire(1,2)

About

Static types for the jQuery API for Scala.js programs.

Topics

Resources

License

Stars

Watchers

Forks

Contributors4

  •  
  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp