First assume we have a element in html that have the attribute " id = 'map' ".
First we add a new division to have three radio buttons to be selected for setting size.
<div id="options">
<form>
<input type="radio" name="size" onchange="setSize(400px, 600px)">400x600
<input type="radio" name="size" onchange="setSize(600px, 800px)">600x800
<input type="radio" name="size" onchange="setSize(100%, 100%)">FullScreen
</form>
<div>
We call setSize(--) function when we select one of the radio button. Then it is the time to define the setSize(--) function.
function setSize(h,w){
document.getElementById("map").setAttribute("style","height:"+h+"; width:"+w+";");
}
that is all...
Hiç yorum yok:
Yorum Gönder