Kir*_*mar 1 dart dart-editor dart-webui dart-js-interop
我在jquery中有一个函数,如下所示
function findMax(){
$( ".elements" ).each(function( ) {
if($(this).css('z-index')>max1)
max1=$(this).css('z-index');
max1=parseInt(max1);
});
}
Run Code Online (Sandbox Code Playgroud)
我必须在Dart语言中实现这个功能.在使用.each函数和'this'函数时遇到语法问题.
相当于jQuery:
$(".elements").each(function( ) {
// do something with this being one of elements with a 'elements' class
// you can access the current element with $(this)
});
Run Code Online (Sandbox Code Playgroud)
在达特:
querySelectorAll('.elements').forEach((Element e) {
// do something with e being one of elements with a 'elements' class
// you can access the current element with e
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
275 次 |
| 最近记录: |