Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

popup webpage

Posted on 2012-03-25
2
Medium Priority
?
439 Views
Last Modified: 2012-03-25
hello - im new to popups and im trying to get this pop up method to work.

what im trying to accomplish is this:

1. have parent page with href link to popup
2. when popup opens it goes to middle of screen
3. when you click on a link in the popup it will take you to the selected page from the parent window of the popup.

i.e. when you click on popup form opens page in center of screen then shows you a list of other href links to choose from. so when you choose the link in the popup window the popup window should close and goto the requested page in the original window.

here the code that i have so far:

javascript popup
<script type="text/javascript">
<!--
function popup(url) 
{
 params  = 'width='+screen.width;
 params += ', height='+screen.height;
 params += ', top=0, left=0'
 params += ', fullscreen=yes';

 newwin=window.open(url,'windowname4', params);
 if (window.focus) {newwin.focus()}
 return false;
}
// -->
</script>

Open in new window


the href onclick
<p align="center"><a href="lang/de/index.php" title="German"  onclick="popup('popup.html')" />Deutsch</a>

Open in new window




thanks in advance for your help!
0
Comment
Question by:only1wizard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
Lalit Chandra earned 2000 total points
ID: 37762969
Ok, you can achieve this more easily as of Jquery made this simple for you.

1.  Just add the jquery and Jquery UI js reference to your page head section.
   <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
       
2. Create a link, which will be responsible to show the popup.
   <a id="ShowPopUp" href ="#"> Show Links </a>

3.  Create the Div with the following markup
    <div id="divPopUp" style="display:none;">
        <a href="xyz.html">Link 1</a>
        <a href="xyz.html">Link 2</a>
        <a href="xyz.html">Link 3</a>
     </div>  
 
4. Now write the code something like below
   $(function() {
           $("#ShowPopUp").click(function() {
                   $("#divPopUp").dialog({width:600,height:500,modal: true});
          });
         $("#divPopUp a").click(function() {
                     window.location.href =$(this).attr("href");  
         });
});

Hope this will solve your problem.
0
 

Author Closing Comment

by:only1wizard
ID: 37763029
thanks for your help i have some tunning to do to it but it works the way i want it to.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Suggested Courses

604 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