问题描述
我试图在javascript中隐藏弹出窗口的URL地址时遇到了一些困难。这是我的HTML:
< div id =menu>
< ul>
< li>< a onclick =PopupCenter('./ about.html','关于ePlanner',600,400); href =javascript:void(0);>关于ePlanner< / a>< / li>
< li>< a onclick =PopupCenter('./ team.html','项目成员',600,400); href =javascript:void(0);>项目成员< / a>< / li>
< li>< a onclick =PopupCenter('./ faq.html','FAQ',600,400); HREF = JavaScript的:无效(0); >常见问题< / A>< /锂>
< / div>
我的javascript用于弹出窗口:
<脚本>
函数PopupCenter(pageURL,title,w,h){
var left =(screen.width / 2) - (w / 2);
var top =(screen.height / 2) - (h / 2);
var targetWin = window.open(pageURL,title,'toolbar = no,location = no,directories = no,status = no,menubar = no,scrollbars = no,resizable = no,copyhistory = no,width = '+ w +',height ='+ h +',top ='+ top +',left ='+ left);
}
< / script>
我想知道是否可以隐藏URL地址以及窗口框架。
谢谢
以上是上述资源的示例[在我的Chrome浏览器中,无框/无边界/无地址的弹出窗口很适用]:
<!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // ENhttp:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
< html xmlns =http://www.w3.org/1999/xhtml>
< head>
< meta http-equiv =Content-Typecontent =text / html; charset = utf-8/>
< meta name =Descriptioncontent =选择一家阿什维尔油画公司,致力于提供最高质量的作品,同时按预算和时间完成作业。 />
< meta name =authorcontent =SCI Painting/>
< meta name =copyrightcontent =2013 SCI Painting/>
< link rel =快捷图标href =http://scipainting.com/images/favicon.ico/>
< link href =http://scipainting.com/css/style.css =stylesheettype =text / css/>
http://www.sitepoint.com/forums/showthread.php?1175628-Remove-browser-box-border-from-pop-up-window
主题:从弹出窗口中删除浏览器框/边框
2013年10月31日,11:11
Sculley
Francky代码
- >
< title> test ::选择质量阿什维尔绘画公司< / title>
< style type =text / css>
html {
height:100%;
overflow-y:scroll;
}
#grayOverlay {
position:fixed;
剩下:0;
top:0;
宽度:100%;
身高:100%;
背景颜色:#000;
不透明度:.7;
z-index:1;
display:none;
}
#center {
position:relative;
}
#popupBox {
top:25px;
left:25px;
right:25px;
bottom:0;
溢出:auto;
背景:#f5f5eb;
border:1px solid#e0e2cc;
padding:10px;
text-shadow:1px 1px white;
z-index:1;
}
h2 {
font-size:1.1em;
font-weight:normal;
}
#closePopupBox1,
#closePopupBox2 {
position:absolute;
right:0;
display:none;
}
#closePopupBox1 a,
#closePopupBox2 a {
margin:15px;
padding:0 4px;
border:1px solid#c0c0c0;
border-radius:6px;
背景:红色;
颜色:白色;
font-size:.8em;
font-weight:bold;
}
< / style>
< / head>
< body>
< div id =grayOverlay>< / div>
< div id =main>
< div id =top>
< div id =header>
< div class =header>< br />
MARC JACKSON< br />>
< a href =mailto:[email protected]> [email protected]< / a>< br />
手机828.442-4107< br />
fax 828.645.6284< br />
65 Monticello Rd./<br />
Weaverville NC 28787
< / div><! - end div .header - >
< / div><! - end div #header - >
< / div><! - end div #top - >
< div id =top-navi>
< / div><! - end div#top-navi - >
< div id =mid>
< div id =left-side>
< a href =#popupBoxonclick =openPop(); return false>
< img width =125height =60alt =别人说什么src =http://scipainting.com/images/quote-web.jpg/>
< / a>
< img src =http://scipainting.com/images/image1-shadow.pngwidth =148height =158class =firstalt =Image 1/>
< img src =http://scipainting.com/images/image2-shadow.pngwidth =138height =141alt =Image2/>
< img src =http://scipainting.com/images/image3-shadow.pngwidth =138height =141alt =Image 3/>
< / div><! - end div left-side - >
< div id =center>
< div align =center>< img src =http://scipainting.com/images/image-main.jpgwidth =634height =292
在北卡罗来纳州阿什维尔附近的北卡罗来纳州伯恩斯维尔的SCI绘画/>
< / div>
< div class =txtbox>
< p>住宅和商业< br />
项目< / p>
< p>内部和外部涂料< br />
和染色服务< / p>
< p>屋顶和地板涂料< / p>
< p>甲板维护和清洁< / p>
< p>压力清洗< / p>
< p> Log home保护< / p>
< p>假人完成< / p>
< / div><! - end div .txtbox - >
SCI Painting成立的目的是为了满足高品质油漆和优质客户服务的需求。
Sineath Construction油漆部门和C. Manning油漆服务公司两家家族企业加盟,b $ b为北卡罗来纳州西部地区提供了无与伦比的服务,卓越性和价值对于今天的家庭非常重要。这两家公司携手40多年来的经验,高质量的工作,可靠的服务,以及长达满意的客户名单
。我们拥有完整的许可证和保险,并期待在油漆公司中您可以选择
。< / p>
< p>经理Marc Jackson专注于满足北方西部地区客户不断增长的需求以及我们恶劣的气候带来的挑战。他和我们经验丰富的员工一起,
了解所有工作,住宅和商业的细节。 Marc致力于提供最高
质量的工作,同时按预算和按时完成工作。直到客户
满意为止,Marc才会满意。这一切都是可能的,因为之前与客户保持明确的沟通,
在项目期间和之后。< / p>
< div id =popupBox>
< h2 id =popHeader>人们说...< / h2>
< div id =closePopupBox1>< a href =#onclick =closePop(); return false> X< / a>< / div>
< p> Meredith Ledford< / p>
< p> 2013年8月21日< / p>
< p> Marc Jackson< br />
SCI绘画< br />
蒙蒂塞洛路65号< br />
Weaverville,NC 28787< / p>
< p>尊敬的杰克逊先生,< / p>
< p>我正在致函您,重申我对bb工作例外的SCI绘画< br />的最深切的谢意。
在我们新家中完成。< / p>
< p>鉴于
工作的大范围和完成时间有限,我丈夫和我特别印象深刻。< / p>
< p>您的专业画家团队在第一天就到达
开始,他们保持高效和热情,直到完成
的工作。因为我的丈夫不在城里,所以大部分时间我都会和你的船员互动。他们总是非常友善和适应。< br />
我特别感动,当他们
向我展示新鲜的苗圃时 - 它是美丽的
!我也很感谢他们的耐心,因为我决定以
的颜色来涂饰。我一直在努力做出这个决定,但我从来没有感到匆忙。< / p>
< p>由于SCI Painting的出色服务,我和我丈夫在我们的儿子出生前就能够完成我们搬入新家的行动。现在我们b $ b每天都在您的新家中欣赏您的手工,并且惊叹于您的工作人员如何有效地完成工作。 SCI绘画是一种价值
的一流商业,它突破了价值和专业的罕见平衡。我们是
,非常感谢我们向您推荐我们的家庭提供
的巨额工作,并会热情地向任何人推荐您的服务。< / p>
< p>再次感谢,我们希望能在The Rock&今年秋天的一些ASU
足球。开始应用!< / p>
< p>此致< / p>
< div id =closePopupBox2>< a href =#onclick =closePop(); return false> X< / a>< / div>
< p> Meredith& amp; amp; amp;德韦恩莱德福德< / p>
< / div><! - end div #popupBox - >
< / div><! - end div #center - >
< / div><! - end div #mid - >
< / div><! - end div main - >
< div id =footer>
< div class =copyright>
< p>& copy;版权所有2013 scipainting.com |保留所有权利< br />>
SCI绘画是一个与< a href =http://www.sineathconstruction.com/> Sineath Construction在
位于美国北卡罗来纳州阿什维尔附近的韦弗维尔的合作伙伴< / a>< p为H.
< / div><! - end div .copyright - >
< div class =copyright>
< p>手机828.645.6284 |传真828.682.0676 | 65 Monticello Rd。 |邮政信箱方框1603 | Weaverville NC 28787< / p>
< / div><! - end div .copyright - >
< / div><! - end div footer - >
< script type =text / javascript>
//<![CDATA [
document.getElementById('popupBox')。style.position =absolute;
document.getElementById('popupBox')。style.display =none;
document.getElementById('popHeader')。style.display =none;
document.getElementById('closePopupBox1')。style.display =block;
document.getElementById('closePopupBox2')。style.display =block;
函数openPop(){
document.getElementById('popupBox')。style.display =block;
document.getElementById('grayOverlay')。style.display =block;
}
function closePop(){
document.getElementById('popupBox')。style.display =none;
document.getElementById('grayOverlay')。style.display =none;
}
//]]>
< / script>
< / body>
< / html>
I am having some difficulties when trying to hide the URL address for pop up window in javascript. Here is my html:
<div id="menu">
<ul>
<li><a onclick="PopupCenter('./about.html', 'About ePlanner',600,400);" href="javascript:void(0);">About ePlanner</a></li>
<li><a onclick="PopupCenter('./team.html', 'Project Members',600,400);" href="javascript:void(0);">Project Members</a></li>
<li><a onclick="PopupCenter('./faq.html', 'FAQ',600,400);" href="javascript:void(0);">FAQ</a></li>
</div>
And my javascript for pop up window:
<script>
function PopupCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL,title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
</script>
I was wondering is it possible to hide the URL address and as well as the window frame.
Thanks in advance.
To achieve Chrome popups without frames, try the code here (you may need to hardcode content from html pages or integrate with iFrames - let me know if you need help doing that portion):http://www.sitepoint.com/forums/showthread.php?1175628-Remove-browser-box-border-from-pop-up-window
Here is the example from the resource above [it works great in my Chrome browser with frameless/borderless/address free popup]:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- only for this testpage! --><meta name="robots" content="noindex, nofollow" />
<!-- http://www.sitepoint.com/forums/showthread.php?1175628-Remove-browser-box-border-from-pop-up-window -->
<meta name="Description" content="Choose an Asheville painting company dedicated to providing the highest quality work while getting the job completed on budget and on time. SCI Painting in Burnsville near Asheville NC." />
<meta name="Keywords" content="painting company,exterior paint company,interior paint company" />
<meta name="author" content="SCI Painting" />
<meta name="copyright" content="2013 SCI Painting" />
<link rel="shortcut icon" href="http://scipainting.com/images/favicon.ico" />
<link href="http://scipainting.com/css/style.css" rel="stylesheet" type="text/css" />
<!--
http://www.sitepoint.com/forums/showthread.php?1175628-Remove-browser-box-border-from-pop-up-window
Thread: Remove browser box/border from pop up window
Oct 31, 2013, 11:11
Sculley
Code by Francky
-->
<title>test :: Choose a Quality Asheville Painting Company</title>
<style type="text/css">
html {
height:100%;
overflow-y:scroll;
}
#grayOverlay {
position:fixed;
left:0;
top:0;
width:100%;
height:100%;
background-color:#000;
opacity:.7;
z-index:1;
display:none;
}
#center {
position:relative;
}
#popupBox {
top:25px;
left:25px;
right:25px;
bottom:0;
overflow:auto;
background:#f5f5eb;
border:1px solid #e0e2cc;
padding:10px;
text-shadow:1px 1px white;
z-index:1;
}
h2 {
font-size:1.1em;
font-weight:normal;
}
#closePopupBox1,
#closePopupBox2 {
position:absolute;
right:0;
display:none;
}
#closePopupBox1 a,
#closePopupBox2 a {
margin:15px;
padding:0 4px;
border:1px solid #c0c0c0;
border-radius:6px;
background:red;
color:white;
font-size:.8em;
font-weight:bold;
}
</style>
</head>
<body>
<div id="grayOverlay"></div>
<div id="main">
<div id="top">
<div id="header">
<div class="header"><br />
MARC JACKSON<br />
<a href="mailto:[email protected]">[email protected]</a><br />
phone 828.442-4107<br />
fax 828.645.6284<br />
65 Monticello Rd./<br />
Weaverville NC 28787
</div><!--end div .header -->
</div><!--end div #header -->
</div><!--end div #top -->
<div id="top-navi">
</div><!--end div #top-navi -->
<div id="mid">
<div id="left-side">
<a href="#popupBox" onclick="openPop();return false">
<img width="125" height="60" alt="What others say" src="http://scipainting.com/images/quote-web.jpg" />
</a>
<img src="http://scipainting.com/images/image1-shadow.png" width="148" height="158" class="first" alt="Image 1" />
<img src="http://scipainting.com/images/image2-shadow.png" width="138" height="141" alt="Image2" />
<img src="http://scipainting.com/images/image3-shadow.png" width="138" height="141" alt="Image 3" />
</div><!--end div left-side -->
<div id="center">
<div align="center"><img src="http://scipainting.com/images/image-main.jpg" width="634" height="292"
alt="SCI Painting in Burnsville NC near Asheville, NC" />
</div>
<div class="txtbox">
<p>Residential and Commercial <br />
projects</p>
<p>Interior and exterior paint <br />
and stain services</p>
<p>Roof and floor coatings</p>
<p>Deck maintenance and cleaning</p>
<p>Pressure washing</p>
<p>Log home protection</p>
<p>Faux finishes</p>
</div><!--end div .txtbox -->
<p>SCI Painting was founded to meet the demand for high quality painting and excellent customer service.
The joining of two family businesses, Sineath Construction’s paint division and C. Manning Paint Service,
provides all of western North Carolina with unmatched services, excellence and value important to families
today. These two companies together bring over 40 years of experience, quality work, reliable service and
a long list of satisfied customers to SCI Painting. We are fully licensed and insured and look forward to
being your choice in paint companies.</p>
<p>Marc Jackson, manager, is focused on keeping pace with the growing needs of clients in western North
Carolina and the challenges that our harsh climate can create. He, along with our experienced employees,
understands the details of all jobs, residential and commercial. Marc is dedicated to providing the highest
quality work while getting the job completed on budget and on time. Marc is not satisfied until the customer
is satisfied. This is all possible because of clear communication that is maintained with the client before,
during, and after the project.</p>
<div id="popupBox">
<h2 id="popHeader">People say...</h2>
<div id="closePopupBox1"><a href="#" onclick="closePop();return false">X</a></div>
<p>Meredith Ledford</p>
<p>August 21, 2013</p>
<p>Marc Jackson<br />
SCI Painting<br />
65 Monticello Rd.<br />
Weaverville, NC 28787</p>
<p>Dear Mr. Jackson,</p>
<p>I am writing to you to reiterate my deepest gratitude for the exceptional
work SCI Painting<br />
completed in our new home.</p>
<p>My husband and I were especially impressed given the large scope of the
job and the limited amount of time afforded to you for completion.</p>
<p>Your team of professional painters arrived on the first day eager to
begin and they remained productive and enthusiastic until the job was
completed. Because my husband was out of town, I interacted with your crew
the majority of the time. They were always very friendly and accommodating.<br />
I was especially touched when they
presented with great pride to me the freshly painted nursery – it was
beautiful! I also appreciated their patience as I decided which color to
paint the trim. I struggled with the decision, but I never felt rushed.</p>
<p>Because of SCI Painting’s excellent service, my husband and I were able
to complete our move into our new home before our son was born. Now we
admire your handiwork every day in our new home and marvel at the how
efficiently your crew completed the work. SCI Painting is a first rate
business that strikes the rare balance of value and professionalism. We are
so grateful that we were referred to you for the huge job our home presented
and would enthusiastically recommend your services to anyone.</p>
<p>Thanks again and we hope to see you at "The Rock" this fall for some ASU
football. Go APPS!</p>
<p>Sincerely,</p>
<div id="closePopupBox2"><a href="#" onclick="closePop();return false">X</a></div>
<p>Meredith & Dwayne Ledford</p>
</div><!-- end div #popupBox -->
</div><!--end div #center -->
</div><!--end div #mid -->
</div><!--end div main -->
<div id="footer">
<div class="copyright">
<p>© Copyright 2013 scipainting.com | All Rights Reserved <br />
SCI Painting is a partnership with <a href="http://www.sineathconstruction.com/">Sineath Construction in
Weaverville, NC near Asheville, NC</a></p>
</div><!--end div .copyright -->
<div class="copyright">
<p>phone 828.645.6284 | fax 828.682.0676 | 65 Monticello Rd. | P.O. Box 1603 | Weaverville NC 28787</p>
</div><!--end div .copyright -->
</div><!--end div footer -->
<script type="text/javascript">
//<![CDATA[
document.getElementById('popupBox').style.position="absolute";
document.getElementById('popupBox').style.display="none";
document.getElementById('popHeader').style.display="none";
document.getElementById('closePopupBox1').style.display="block";
document.getElementById('closePopupBox2').style.display="block";
function openPop(){
document.getElementById('popupBox').style.display="block";
document.getElementById('grayOverlay').style.display="block";
}
function closePop(){
document.getElementById('popupBox').style.display="none";
document.getElementById('grayOverlay').style.display="none";
}
//]]>
</script>
</body>
</html>
这篇关于用隐藏的URL地址弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!