Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-02-2011, 06:19 AM   PM User | #1
alfehaieotasdh
New to the CF scene

 
Join Date: Dec 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
alfehaieotasdh is an unknown quantity at this point
in page popup window

Hi

I want to create a popup that is completely contained within the page (so i guess its not really a popup). I'm looking for something where if a button is clicked, a small box will come up in the current window and become the active window, while the original window is visible but not active.

It's hard to explain, but its a popup that is contained in the same window. And when the user presses okay or cancel on the "popup" window. They return to where they were in the original window. Is this possible? How would I do it?

Thanks
alfehaieotasdh is offline   Reply With Quote
Old 01-02-2011, 04:37 PM   PM User | #2
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,764
Thanks: 29
Thanked 453 Times in 447 Posts
jmrker will become famous soon enough
Google is your friend:
See: http://www.javascript-coder.com/wind...p-window.phtml
and: http://javascript.internet.com/gener...up-window.html
and: http://www.blazonry.com/javascript/windows.php
and: http://www.webdevelopersnotes.com/tu...avascript.php3
and many others.
jmrker is offline   Reply With Quote
Old 01-03-2011, 12:11 AM   PM User | #3
alfehaieotasdh
New to the CF scene

 
Join Date: Dec 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
alfehaieotasdh is an unknown quantity at this point
I'm actually not looking for a regular popup. I'm looking for something like this:

http://okonet.ru/projects/modalbox/
(click on start demo or see it in action near the bottom)

However, i had some trouble using the code that I found online. Mainly, I couldn't create a button on the popup that has a function for its onclick. So, i need some help solving that issue if someone has work with modalbox before, or if anyone can help me create my own inline popup.

Thanks
alfehaieotasdh is offline   Reply With Quote
Old 01-03-2011, 01:36 AM   PM User | #4
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,764
Thanks: 29
Thanked 453 Times in 447 Posts
jmrker will become famous soon enough
Lightbulb

Quote:
Originally Posted by alfehaieotasdh View Post
I'm actually not looking for a regular popup. I'm looking for something like this:

http://okonet.ru/projects/modalbox/
(click on start demo or see it in action near the bottom)

However, i had some trouble using the code that I found online. Mainly, I couldn't create a button on the popup that has a function for its onclick. So, i need some help solving that issue if someone has work with modalbox before, or if anyone can help me create my own inline popup.

Thanks
Here's another idea ...
Pay the author and ask him/her.
jmrker is offline   Reply With Quote
Old 01-03-2011, 02:45 AM   PM User | #5
Krupski
Regular Coder

 
Krupski's Avatar
 
Join Date: Dec 2010
Location: United States of America
Posts: 502
Thanks: 39
Thanked 47 Times in 46 Posts
Krupski is on a distinguished road
Quote:
Originally Posted by alfehaieotasdh View Post
Hi

I want to create a popup that is completely contained within the page (so i guess its not really a popup). I'm looking for something where if a button is clicked, a small box will come up in the current window and become the active window, while the original window is visible but not active.

It's hard to explain, but its a popup that is contained in the same window. And when the user presses okay or cancel on the "popup" window. They return to where they were in the original window. Is this possible? How would I do it?

Thanks
Maybe this:

Code:
/**
* A decent popup window
**/
function popup(url, width, height, name)
{
    if (!name) { name = 'popup'; }
    var yes = ['scrollbars','resizable','dependent'];
    var no = ['toolbar','location','directories','status','menubar','fullscreen','channelmode'];
    var y = yes.length;
    var n = no.length;
    var lpos = (screen.width) ?  parseInt((screen.width - width) *   (1/2)) : 0; /* centered L-R */
    var tpos = (screen.height) ? parseInt((screen.height - height) * (1/4)) : 0; /* 1/4 from the top */
    var settings = 'height=' + height + ',width=' + width + ',top=' + tpos + ',left=' + lpos;
    var options = '';
    while (y--) { options += ',' + yes[y] + '=1'; }
    while (n--) { options += ',' + no[n] + '=0'; }
    window.win = window.open(url.replace(/&/g, '&'), name, settings + options);
    if (window.focus) { window.win.focus(); }
    return false;
}
__________________
"Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto." -- Mikhail T. Kalashnikov
Krupski is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:11 PM.


Advertisement
Log in to turn off these ads.