Close Window

classic Classic list List threaded Threaded
18 messages Options
JP
Reply | Threaded
Open this post in threaded view
|

Close Window

JP
Hi, is there an easy way to implement a "close" link within a shadowbox window?

some users have trouble finding the small "x" on the lower-right to close the shadow box window. I would like an option to insert a "close window" link within the shadowbox window itself, perhaps at the top of the page to help users understand that they can also close the window by clicking this link.

Is this possible?
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

Mircea M
Clicking anywhere outside the box will close it. Isn't that enough?

M
JP
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

JP
I totally agree - it's enough for me, but the users are writing in complaining and confused!
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

Mircea M
wow...I never thought of that. However, I guess you can change the image close.png to a "close window.png in the library folder.

Mike
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

moikirsch
In reply to this post by JP
Try something like this:

< a href="#" on click="Shadowbox.close()">Close

or

< a href="#" on click="window.parent.Shadowbox.close()">Close

I haven't test it but I'm pretty sure that one of those (or something VERY close) will do the trick.

(I had to add some spaces so the forum would let me post the code)
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

Will Fastie
I don't see a "close" method documented in the API here.

www.fastie.com, Baltimore, MD USA.

Reply | Threaded
Open this post in threaded view
|

Re: Close Window

moikirsch
There was no need for me to see the API to discover this... it just takes a second to right click on the close button, copy the link and check the results.

You can download the source and look at it completely... is very well documented and there are some other features undocumented (such as the fact that you might change the HTML code pretty easily).
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

Tony
In reply to this post by moikirsch
Thanks it works for me

Reply | Threaded
Open this post in threaded view
|

Re: Close Window

miklos
In reply to this post by moikirsch
 it's usually defined as "onClick" = one word in Javascript and no it doesn't work. I agree, we need better options for the close "X" it's hard to see sometimes for users.
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

dloop
within shadowbox.js

find < a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()" >< /a >

replace with < a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()" >Close< /a >

add the word "Close" next to the "X". you may need to adjust css.

Reply | Threaded
Open this post in threaded view
|

Re: Close Window

Evan
In addition to specifying text, it would be pretty great if there was an option to decide on a different corner of the box.

Maybe this requires a little shuffling on the title also, but in keeping consistent with application windows, top left and top right are more likely places for a user to look for that "close" functionality.

And come to think of it, allowing the title below the main box might make sense too.  A lot of what shadowbox is used for is images, right?  Flickr and newspapers tend to put captions below pictures.

The defaults aren't radically wacky, but do seem a bit non-standard.  It would be great to have an easier time at changing them.

-Evan

Reply | Threaded
Open this post in threaded view
|

Re: Close Window

Andy
Users typically expect that clicking on the image itself would close the overlay (I think this quite a natural expectation). The cross for closing is very small, so hard to find and quite annoying to hit it when looking at several images - therefore it would be really great to have an option available to turn this on/off!

Unfortunately, I couldn't get the 'onClick' working in the image definition itself as it was proposed.

Are there maybe any other ideas how to close the image-overlay by clicking directly on the image itself? Many thanks for any hints, Andy
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

ki11ua
This post was updated on .
I totally agree with Andy.
I love and use shadowbox at 100% of the sites that I develop.
But, all other solutions (e.g lightbox, prettybox etc) have the option to close onclick at overlay by default.

A simple solution for that is to open shadowbox.js and find the line
<div id="sb-overlay"> and replace it by <div id="sb-overlay" onclick="Shadowbox.close()">.

Exactly like ...id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"> behavior.

I tested in all major browsers and it doesn't seem to have any side effects. Let's hope to be embedded in next release.


Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

Paul
In reply to this post by JP
I'm not sure why people have made this so difficult.  The simple answer is Shadowbox.close() as was already mentioned but you must first tell your modal window what 'Shadowbox' is:

<script type="text/javascript"> var Shadowbox = window.parent.Shadowbox; </script>
<a href="#" onclick="Shadowbox.close();">close me
TAO
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

TAO
Don't know if this thread is still open - or being watched, but....  I'm having the same type of issue with closing my shadowbox.  I'm displaying an HTML page in the shadowbox, using jQuery.  In IE7/IE8, the close button, and javascript in an onclick event on a button control in the HTML close the shadowbox, but it FF4, FF3.6,Opera10.5 and Safari 4.0.4, neither the close button or the onclick javascript work.  I tried identifying the shadowbox object in the modal window with:

<script type="text/javascript"> var Shadowbox = window.parent.Shadowbox; </script>
and that didn't help.

Has there been any other fixes posted anywhere to this - or other suggestions to try?  I'm running ShadowBox 3.0.3.

Thanks for any info.
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

KWill
In reply to this post by ki11ua
This did not work for me. When I click on my image, it goes to Youtube. Also, I agree that users are not going to intuitively know how to close the shadowbox.
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

Ek3ekytop
Agree with that. Is it possible to close shadowbox on mouse click over youtube clip ?? I'm spending a lot of hours trying to find any solution for this but without success. Is this possible with shadowbox?
Reply | Threaded
Open this post in threaded view
|

Re: Close Window

Nitesh
In reply to this post by moikirsch
Thanks dude it works for me..:)