English 中文(简体)
create a "show up" window when you click register?
原标题:

im a backend programmer who wants to have a window that appears in front of the current window when clicking "register".

so that you dont have to redirect to another page.

i think u guys know what i mean.

how do i do that? is it with jquery or javascript? is ajax involved?

and what is that kind of popup box called?

问题回答

You want to write a div into your HTML that contains your login fields (i.e. the popup window). Set it to position:absolute; and position with CSS so it floats above the page contents and doesn t interrupt the flow when it appears. Get it all nice and positioned where you want it, then set it to display: none; so it will wait for javascript to make it appear.

Then (using jQuery), write something like this:

$( #register ).click(function() {
    $( #popup ).show();
});

where #register is whatever gets clicked (can be most anything with id="register").

What happens whenever that form is submitted is up to you, and not any different from the options you d have with any other HTML form. jQuery can help with AJAX if you decide to go that route and not send the surfer to another page to process the form.

It can be done using quite a few totally different approaches. As Sam said it s the concept of modal boxes.

You could do it completely on the client side using CSS and JavaScript (alternative), or via AJAX and some third-party libs.

Try being a bit more specific - what s the the backend/frontend environment? Is performance an issue (eg. minimal client-server communication)?

I believe you re referring to a modal form. You can search for modal popup javascript. There is a good javascript component called Lightbox that will help as well.

EDIT:

I mentioned Lightbox, but Lightbox Gone Wild is the one I meant. As others have pointed out, using a modal tool like this all you do is write the html you want to be displayed in the modal popup. That link is a good tutorial on the concept and explains things well.





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签