Toddish / Popup

A barebones, flexible jQuery popup plugin. Designed for developers, it's simple to use but very powerful.
http://docs.toddish.co.uk/popup
MIT License
146 stars 78 forks source link

Access to the parent element #14

Closed nobe4 closed 9 years ago

nobe4 commented 9 years ago

Hello, Great plugin, thanks for developping it ! :) I'm using it on a small project and I wanted to know how you can pass the original window element to the popup ?

The use-case is the following : I have a main page M with a link L When I click on the link the popup P shows In P there is a redirect link R When I click on R the popup close and M gets redirected on another url

I wasn't able to achieve this effet, and I started to pass the original window argument to set a new location but I wasn't able to do anything good.

Do you have any idea ? Thanks :)

Toddish commented 9 years ago

Is this all in the same window? I'm a little confused about the set up.

If you're opening an iframe in the popup (which I presume is this plugin), then try setting the target to the redirect as 'top'.

If this is all in a new window (in which case, I don't see how the plugin is being used), try using 'opener.location.href'.

I might have completely misunderstood though!

nobe4 commented 9 years ago

Yes, all in the same windows, the popup open another page. I'll try this and let you know, thanks :)

Edit :

Works like expected with :

<a href="agoodsite.io" target="_top">click here</a>

Thanks again :)

Toddish commented 9 years ago

Awesome, glad you got it sorted :D