<html><body>
<div id="ttd" style="position:absolute;left:20%;top:80%;height:100px;width:100px;background-color:lightpink"><a href="javascript:dtte()"><div id="ttdenlarge" style="position:absolute;bottom:1%;right;1%;width:5%;height:5%;background-color:greenyellow"></div></a></div>
<script type="text/javascript">
function dtte() {
var originalttdwidthandheight = document.getElementByID("ttd").style.width
var ttdwidthandheight = originalttdwidthandheight*1.25
var shiftamount = (ttdwidthandheight-originalttdwidthandheight)/2
var ttdleft = document.getElementByID("ttd").style.left
var ttdbottom = document.getElementByID("ttd").style.bottom
document.getElementByID("ttd").style.width = ttdwidthandheight + "px"
document.getElementByID("ttd").style.left = ttdleft+shiftamount
document.getElementByID("ttd").style.height = ttdwidthandheight + "px"
document.getElementByID("ttd").style.left = ttdbottom+shiftamount
}</script>
</body></html>
with some modifications, the code should now display a button inside the soft pink blob, and clicking that button should enlarge the blob (and the button) ... around the lower left corner of the blob.
No comments:
Post a Comment