?
Solved

How to link to a new window without showing tool bars on all browser

Posted on 2009-12-19
7
Medium Priority
?
221 Views
Last Modified: 2013-12-25
Dear Experts:

In my website, I have links to photos on another web page. Please try clicking the 'click here to view large image' link, you'll see another window pops up, as usual, with all the tool bars:
http://www.labelladonna.likescandy.com:8888/Details.asp?ProdID=38&category=0 

What will be the steps to take away all the bars?  like what this webpage will show you when you click their 'View Full Size Image' link: http://www.net-a-porter.com/product/49786# 

Thank you


0
Comment
Question by:causewaybay
  • 3
  • 2
  • 2
7 Comments
 
LVL 11

Expert Comment

by:asafadis
ID: 26089006
0
 

Author Comment

by:causewaybay
ID: 26089426
Dear asafadis:

In 12 minutes you get my 500 points.  Experts-Exchange should be proud of you.  I think I'm luck to have you came across my question.  There remains only one issue, whether you answer it or not (you can simply tell me to open up a new question, this 500 points will still go to you with the same gratitude).  The issue is:  if I want each new windows to be opened in a different width and height, instead of a standardise, fixed width and height, what should I do? Is there a handy script available? Or will someone in the link you recommand answer such questions?

Thanks a million!
0
 
LVL 11

Accepted Solution

by:
asafadis earned 2000 total points
ID: 26089653
Thank you for your kind words sir!  Let's see if I can live up to them again...

So the generator created a "popUp" function that accepts 1 argument (URL).  We're going to add 2 more arguments, width and height.

/* Depending on the option you selected in the generator site,
 * your function probably looks a little different.
 * My modifications should still work though.
 */

function popUp(URL, width, height) {

    // If no width/height is provided, set some default values
    width  = typeof(width)  != 'undefined' ? width  : '600';
    height = typeof(height) != 'undefined' ? height : '400';

    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + width + ",height=" + height + "');");
}

Open in new window

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 26089825
1. please use vars inside functions
2. please do NOT use eval - no need at all
3. No need to define all the parameters - if you want all off, just define one of them
4. gracefully degrade if no javascript or a popup blocker is active

For example

var pageIds=[];
function popUp(URL, width, height) {
// If no width/height is provided, set some default values
  var width  = (width) ? width  : '600';
  var height = (height)? height : '400';
  var id = "p"+new Date.getTime();
  pageIds[id]= window.open(URL,id,'toolbar=0,resizable,width=" + width + ",height=" + height);
  return pageIds[id]?false:true;
}

And call it:
<a href="page1.html" target="_blank" onClick="return popUp(this.href,500,400)">Pop</a>

Open in new window

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 26089828
PS: A much better solution is greybox, lightbox or ceebox
http://catcubed.com/2008/12/23/ceebox-a-thickboxvideobox-mashup/
0
 

Author Closing Comment

by:causewaybay
ID: 31668232
Thank you Asafadis! You not only help me to open a new window, you also help open a new window for me in the world of Javascripts!  I never write a javascript; and you make it so easy for me.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 26090451
????
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question