Archive for the ‘Computer Programming’ Category

Wrapper/outer div to keep inner div top right regardless of resolution:

Wednesday, January 13th, 2010

Wrapper/outer div to keep inner div top right regardless of resolution:

<html><head>
<style type=”text/css”>
#divnamewrap{
height:140px;
width:100%;
position:absolute;
left:0px;
top:0px;
}
#divname{
height:140px;
width:185px;
position:relative;
z-index:0;
float:right;
}
</style>
</head>

<body>
<div id=”divnamewrap”>
<div id=”divname”>div content here </div> <!– top right this div will appear that’s why we used wrapper so that change of resolution should keep it on right –>
</div>
</body>
</html>

Post to Twitter Tweet This Post

  • Share/Bookmark

Vanishing a div using JavaScript timer and CSS display none

Monday, January 11th, 2010

Vanishing a div using JavaScript timer and CSS display none

<html>
<head>
<script type=”text/javascript”>
function timedMsg() {
var t=setTimeout(“document.getElementById(‘vanish’).style.display=’none’”, 5000);
}
window.onload=timedMsg;
</script>
</head>
<body>
<div id=”vanish” style=”position:absolute;left:420px;top:750px;”>Game loads after trailer</div>
</body>
</html>

<html> <head> <script type=”text/javascript”> function timedMsg() { var t=setTimeout(“document.getElementById(‘vanish’).style.display=’none’”, 5000); } window.onload=timedMsg; </script> </head> <body> <div id=”vanish” style=”position:absolute;left:420px;top:750px;”>Game loads after trailer</div> </body></html>

Post to Twitter Tweet This Post

  • Share/Bookmark