要表明我的变化coloring the changed area in green - 请参阅图片。 当点击它时,Javascript将返回"标题"中的内容。将使用本机iOS代码弹出显示的属性。 现在我想在滚动时将弹出窗口限制为仅限绿色区域。有没有办法javascript返回绿色的尺寸,以像素为单位。或者有更好的替代方法来实现这个
附上样本图片。 Javascript代码
function initialize(){
$("a[name*='changesColor']").each(function(){
$(this).attr("onclick","");
$(this).click(function(){
sendCommand("tip_change",$(this).parent().attr('title'), height);
});
});
}
Html代码
`<div title="Adds reference to the eFAOM regarding the delegation of authority to the Managing Director, Inflight Safety and Training to maintain and revise information as needed.">
<a xmlns:atict="http://www.arbortext.com/namespace/atict" name="changesColor2" id="changesColor2">
<div class="highlight" style="background-color:#D1FFD1;">
<div class="para_space" id="d12957e3748">Delegates the authority to maintain and the FAOM/eFAOM to the Managing Director, Inflight Safety and Training.
</div>
</div>
</a>
</div>
`
iOS代码
if([command isEqualToString:@"tip_change"]){
NSString *text = params!=nil?[params objectAtIndex:0]:nil;
if (text==nil) {
return;
}
[self showTips:text atPoint:lastTouchPoint];
return;
}