Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

kedar

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

Customize JavaScript Popup Window Code in sigle one line

Oneline JavaScript Popup Window Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <title></title>
</head>

<body>
        <a href="#"
        onClick="MyWindow=window.open('http://www.yahoo.com','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=300,left=0,top=0'); return false;">
        Popup Window Code in single one line without any function</a>

</body>

</html>

Iframe size Fix

Iframe size fix Script
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <title></title>

  <script language="javascript">

          function adjustIFrameSize(id) {
var myIframe = document.getElementById(id);
if (myIframe) {
if (myIframe.contentDocument &&
myIframe.contentDocument.body.offsetHeight) {
// W3C DOM (and Mozilla) syntax
myIframe.height =
myIframe.contentDocument.body.offsetHeight;
} else if (myIframe.Document &&
myIframe.Document.body.scrollHeight) {
// IE DOM syntax
myIframe.height =
myIframe.Document.body.scrollHeight;
}
}
}
  </script>
</head>

<body onload = "adjustIFrameSize('myFrame');">

        <iframe id="myFrame" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" width="100%" src="external.html"
scrolling="no" style="overflow:visible"></iframe>


</body>

</html>

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS