Go Back   HTMLCenter Web Development Forums > Web Design and Development > Programming and Scripting

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 07-17-2007, 12:41 PM
Registered User
 
Join Date: Jul 2007
Posts: 2
Smile Brand New, Many Questions

Hi, I am not a skilled HTML guy, and have many questions, so I'll start with an easy one: We simply want to have a fixed-sized window appear when someone clicks a link that is going to present them with a "definition text" screen...in other words, you click a link called "horse" and a new window pops up at a fixed size (say, 600x400) with a text-only definition for you. I appreciate any help...my next question is going to be about htaccess. FYI, I check the archives, but did not find info sufficient for my skill level/brain power.

Thank You.

-kev
Reply With Quote

  #2 (permalink)  
Old 07-17-2007, 06:25 PM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,391
You need to use javascript to do this.

You should code your links like this:
Code:
<a href="http://www.yourdomain.com/yourpage.htm" target="myWindow" onclick="return window.open(this.href, this.target, 'width=600, height=400');">My link</a>
That should do it. That link will open a window that is 600x400 if the user has javascript enabled. If javascript is disabled, it will just open the link in a new window.
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote
  #3 (permalink)  
Old 07-19-2007, 01:15 PM
Registered User
 
Join Date: Jul 2007
Posts: 2
Smile Thank You, Curtiss...

...I appreciate the help. However, I am not clear on the following variables (noted with an arrow):

<a href="http://www.yourdomain.com/yourpage.htm" target=

"myWindow" <-----------

onclick=

"return window.open(this.href, this.target, <-----------

'width=600, height=400');">

My link <-----------

</a>

THANK YOU - kev
Reply With Quote
  #4 (permalink)  
Old 07-19-2007, 03:09 PM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,391
The target is just an arbitrary name you can assign to the window that will open. By giving the window a name, you can set up your links so that all of your "pop-up" links open in the same window, rather than creating multiple new windows.

"this.href" and "this.target" have to stay exactly as they are. "this.href" tells the browser that you want the link to direct the user to the URL listed in the "href" portion of the link. "this.target" tells the browser that you want the link to open in the window specified in the "target" portion of the link.

Basically, "this" is a way of telling javascript to find the attributes within the tag that's calling that javascript.

"My link" can be anything you want it to be. That's the text of the link that will open the window.
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -5. The time now is 04:40 PM.

 
KickApps
Clicky Web Analytics


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter