当我使用solidity编译简单合约时,我有一个问题。 它是这样的:
(function($) {
$.fn.visible = function(partial) {
var $t = $(this),
$w = $(window),
viewTop = $w.scrollTop(),
viewBottom = viewTop + $w.height(),
_top = $t.offset().top,
_bottom = _top + $t.height(),
compareTop = partial === true ? _bottom : _top,
compareBottom = partial === true ? _top : _bottom;
return ((compareBottom <= viewBottom) && (compareTop >= viewTop));
};
})(jQuery);
var win = $(window);
var allMods = $("#slide-1, #slide-2");
allMods.each(function(i, el) {
var el = $(el);
if (el.visible(true)) {
el.addClass("already-visible");
}
});
win.scroll(function(event) {
allMods.each(function(i, el) {
var el = $(el);
if (el.visible(true)) {
el.addClass("come-in");
}
});
});
我不知道为什么结果是&#34;未定义&#34;,出了什么问题?我在mac os上使用它。
答案 0 :(得分:3)
根据JavaScript中的Greeter variables are all undefined and contract doesn't run undefined
并不是件坏事。变量声明始终返回undefined
,无需担心。
所以要回答你的问题,没有错,只需继续编译clientContract
并忽略undefined
返回消息。