Solved

popup webpage

Posted on 2012-03-25
2
430 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 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

719 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