Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<select>
<option title="one" value="uno">1</option>
<option title="two" value="duo">2</option>
<option title="three" value="tierce">3</option>
</select>
<html>
<head>
<style>
#boxDiv{
margin:0;
padding:0;
border:0;
}
#mySelect{
top:0;
left:0;
width:200px;
height:10px;
}
#myIframe{
position:absolute;
width:182px;
height:21px;
z-index:4;
}
</style>
<script>
var f;
function moveTextbox()
{
f = document.getElementById("myIframe");
var d = document.getElementById("mySelect");
f.style.top = d.offsetTop;
f.style.left = d.offsetLeft;
}
function expandMe()
{
f.style.height = "100px";
}
function shrinkMe(span)
{
if(!f.style.height || f.style.height == "21px")
{
expandMe();
return;
}//end if
else
{
f.style.height = "21px";
if(span)
{
var te = span.innerHTML;
var ti = span.title;
var s = document.frames['myIframe'].document.getElementById("chosen");
s.innerHTML = te;
s.title = ti;
}//end if
}//end else
}//end shrinkMe()
</script>
</head>
<body onload='moveTextbox()'>
<div id='boxDiv'>
<select id='mySelect' onclick='setTimeout("document.getElementById(\"myIframe\").focus();shrinkMe();",0);'>
</select>
</div>
<iframe id='myIframe' scrolling='no'></iframe>
<script>
var frameHTML = "<html><head><style>#myText{position:absolute;top:0;left:0;width:182px;} span{cursor:hand;width:182px;}#chosen{border-bottom:1 solid black;}</style></head><body><div id='myText'></div></body></html>";
document.frames['myIframe'].document.write(frameHTML);
var fd = document.frames['myIframe'].document.getElementById("myText");
var fdInnerHTML = "<span id='chosen' title='' onclick='parent.shrinkMe(this);'>Choose one...</span><br />";
fdInnerHTML += "<span title='' onclick='parent.shrinkMe(this);'>Choose one...</span><br />";
fdInnerHTML += "<span title='one' onclick='parent.shrinkMe(this);'>one</span><br />";
fdInnerHTML += "<span title='two' onclick='parent.shrinkMe(this);'>two</span><br />";
fdInnerHTML += "<span title='three' onclick='parent.shrinkMe(this);'>three</span><br />";
fd.innerHTML = fdInnerHTML;
document.frames['myIframe'].document.close();
</script>
</body>
</html>
<html>
<head>
<style>
#myIframe{
width:182px;
height:21px;
}
#fakeArrow{
visibility:hidden;
position:absolute;
}
</style>
<script>
var f;
function init()
{
f = document.getElementById("myIframe");
//position arrow image
var a = document.getElementById("fakeArrow");
// a.style.top = f.offsetTop;
// a.style.left = f.offsetLeft + f.offsetWidth;
a.style.height = f.offsetHeight;
a.style.width = a.offsetHeight;
a.style.visibility = 'visible';
}//end init()
//opens up "drop-down"
function expandMe()
{
f.style.height = "100px";
}//end expandMe()
var highlightedObject = null;
//closes or opens "drop-down", depending on current state
function shrinkMe(span)
{
//if first time here or in collapsed state:
if(!f.style.height || f.style.height == "21px")
{
expandMe();
return;
}//end if
else //in expanded state
{
f.style.height = "21px";
if(span) //param not sent when fakeArrow clicked
{
var te = span.innerHTML;
var ti = span.title;
var s = document.frames['myIframe'].document.getElementById("chosen");
s.innerHTML = te;
s.title = ti;
}//end if
hightlightObject();
}//end else
}//end shrinkMe()
//unhighlights currently highlighted object AND
// highlights parameter object (if sent)
function hightlightObject(obj)
{
//un-highlight previous hightlighted object
if(highlightedObject)
{
highlightedObject.style.backgroundColor = 'white';
highlightedObject.style.color = 'black';
highlightedObject = null;
}//end if
//hightlight current object
if(obj)
{
obj.style.backgroundColor = 'blue';
obj.style.color = 'white';
highlightedObject = obj;
}//end if
}//end hightlightedObject(obj)
</script>
</head>
<body onload='init()'>
<iframe id='myIframe' scrolling='no'></iframe>
<img id='fakeArrow' src='fakeArrow.gif' onclick='shrinkMe();' />
<script>
//build skeleton of iframe
var frameHTML = "<html><head>";
frameHTML += "<style>";
frameHTML += "#myText{position:absolute;top:0;left:0;width:182px;}";
frameHTML += "span{cursor:hand;width:182px;}";
frameHTML += "#chosen{border-bottom:1 solid black;}";
frameHTML += "</style></head>";
frameHTML += "<body><div id='myText'></div></body>";
frameHTML += "</html>";
document.frames['myIframe'].document.write(frameHTML);
//insert "drop-down" options (spans)
var fd = document.frames['myIframe'].document.getElementById("myText");
var fdInnerHTML = "<span id='chosen' title='' onclick='parent.shrinkMe(this);'>Choose one...</span><br />";
fdInnerHTML += "<span title='' onclick='parent.shrinkMe(this);' onmouseover='parent.hightlightObject(this);'>Choose one...</span><br />";
fdInnerHTML += "<span title='one' onclick='parent.shrinkMe(this);' onmouseover='parent.hightlightObject(this);'>one</span><br />";
fdInnerHTML += "<span title='two' onclick='parent.shrinkMe(this);' onmouseover='parent.hightlightObject(this);'>two</span><br />";
fdInnerHTML += "<span title='three' onclick='parent.shrinkMe(this);' onmouseover='parent.hightlightObject(this);'>three</span><br />";
fd.innerHTML = fdInnerHTML;
document.frames['myIframe'].document.close();
</script>
</body>
</html>