Javascript Tutorial


| Section 1 | Section 2 | Section 3 | Section 4 |
| Section 5 | Section 6 | Section 7 | Section 8 |
| Section 9 | Section 10 |


How do I add a pop-up window?
How do I add a frame break on my page?



How do I add a pop-up window?   This script opens a new window when your visitor clicks on the button. You can make the window any size, and you can change other attributes also:



Here is the code:



You can make a window pop-up with an image link also, but the code is a little different. You would add the following code to your <head> tag:



Next you have to add this code where you want the image link to appear (substitute the word "popup" in the above and below codes to reflect the name of YOUR window, and substitute your info where you see bold text:

<a href="javascript:popup()"><img src="blah.gif" border=0 width="40" height="40" alt="your image description here"></a>


With the following code you can also use a plain text link to open a new window:

<a href="javascript:popup()">Click here for popup window"</a>

You can position your window anywhere you want it to appear by adding left and right positioning numbers to any of the codes above:

{ window.open ("blah.html","popup","width=yourwidth,height=yourheight,location=0,menubar=0, resizable=0,scrollbars=0,status=0,titlebar=1,toolbar=0 , left=your number here, top=your number here") }

up


How do I add a frame break on my page?   A frame break is nice to add to your page. A lot of times when people are surfing they get stuck in someone's frames. If you add this to your page you can provide a place for someone to get out of the frames:

Stuck in someone else's frames?<a href="index.html" target=_top> break free!</a>

You can add this code to your page to have people break free from frames automatically when they come to your page, but I like to use the example above. Here is the code for the automatic frame break (put it between the head and title tags):

<script language="JavaScript"><!--
if (parent.frames.length>=1) {
window.top.location.href="index.htm";
}
// --></script>

up





| About Lissa | Privacy Statement | Contact | Link Us |

Copyright 1997-2016 Lissa, All rights reserved
This Web site is registered with the Library of Congress Copyright Office.


lissaexplains.com


Lissa Explains it All -- HTML Help for KidsHTML Help, css, frames, tables, div layersCustom CursorsHTML Help ForumFree E-mail Service for Kids (and adults who love bright colors ;)Lissa Explains it All -- Free PostcardsLissa Explains it All -- MerchandiseLissa Explains it All -- Guestbook
HTML BasicsHTML TutorialCSS TutorialFrames TutorialTables TutorialColor TutorialFree JavascriptsFun Free Stuff for your siteMySpace TutorialHTML Tutorial
spacer