<html>
<head>
<script src="runtime/lib/aw.js" type="text/javascript"></script>
<link href="runtime/styles/system/aw.css" rel="stylesheet">
</head>
<body>
<div style="overflow: scroll; width: 400px; height: 200px; border: 1px solid green;">
<div style="width: 800px; height: 400px; border: 1px solid red;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ultrices turpis cursus sem porta
<span id="combo1"></span>
</div>
</div>
<script type="text/javascript">
var itemTextArray = ["Home", "Favorites", "Font size", "Search"];
var itemImageArray = ["home", "favorites", "fontsize", "search"];
var combo = new AW.UI.Combo;
combo.setId("combo1");
combo.setControlText("Combo");
combo.setControlImage("favorites");
combo.setItemText(itemTextArray);
combo.setItemImage(itemImageArray);
combo.setItemCount(4);
combo.refresh();
</script>
</body>
</html>
if (AW.webkit){
if (document.documentElement.getBoundingClientRect){ // Safari 4
AW.getLeft = function(element){
return element.getBoundingClientRect().left;
};
AW.getTop = function(element){
return element.getBoundingClientRect().top;
};
}
else {
AW.getLeft = function(element){
return webkitGetRectangle(element).left - webkitGetScroll(element).left;
};
AW.getTop = function(element){
return webkitGetRectangle(element).top - webkitGetScroll(element).top;
};
var webkitGetRectangle = function(e){
var t = e, x = 0, y = 0;
function getPos(el){
if (!el) {
return {x:0, y:0};
}
if (el == document.body.parentNode){
return {x:0, y:0};
}
if (el == document.body){
return {x:el.offsetLeft, y:el.offsetTop};
}
var p = el.offsetParent;
var pp = getPos(p);
return {
x: el.offsetLeft + pp.x,
y: el.offsetTop + pp.y};
}
var pp = getPos(e);
return {
left: pp.x,
right: pp.x + e.offsetWidth,
top: pp.y,
bottom: pp.y + e.offsetHeight
};
};
var webkitGetScroll = function(e){
var s = {left: 0, top: 0};
e = e.parentNode;
while (e && e !== document.body && e !== document.documentElement){
s.left += e.scrollLeft;
s.top += e.scrollTop;
e = e.parentNode;
}
return s;
};
}
}
This topic is archived.