Jump to content

popup close button


dotkpay

Recommended Posts

Hello,

 

Am trying to position a png image on a jquery popup so that it will act as a close button.

The button should protrude out of the popup at the top right corner.

So how should I position this png image from the css layout file without having to include it in my html content.

Remember the main popup frame which is actually <div> has other child elements with content. So how do I make this button a direct child of the popup frame and not its other child elements.

 

Thanks in advance.

Link to comment
Share on other sites

Not sure if you solved this by now but it doesn't need to be very complicated.

 

 

Wrap your popup element in a new div. Give this div position:relative. This is so you can position your anchor tag (coming next).

 

Then create an anchor tag and style it as a block and set the background image to your png. Let's assume you apply a class to this element to acheive the styling. And lets assume the calss is 'closeButton'

 

Then you just need some simple jquqery

 


$(".closeButton").click(function(){

  $('#ID_of_popup_container').fadeOut('fast');

});

 

Hello,

 

Am trying to position a png image on a jquery popup so that it will act as a close button.

The button should protrude out of the popup at the top right corner.

So how should I position this png image from the css layout file without having to include it in my html content.

Remember the main popup frame which is actually <div> has other child elements with content. So how do I make this button a direct child of the popup frame and not its other child elements.

 

Thanks in advance.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.