Close Button on top with 3.0b....

21 messages Options
Embed this post
Permalink
1 2
MartinB

Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
Hi,

Well, in my opinion ShadowBox totally rocks ! It is the best script of its kind and I really like it.

Just one little thing does not make sens to me: the close button being on the buttom. It is original, but really not ergonomical.

With version 2.0 I had a custom skin and so it was ok.
Now with version 3.0, custom skin are not too obvious so I am just wondering if I missed something easy and quick to change position of the "close" button.
I think many people are intersted in costumizing this part...

Anyone who costumized it on the 3.0b is welcome to share his knowledge ;-)


Thanks... and keep up the good work, ShadowBox is the best :-)

Martin
Luis

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
I have this problem too, want to customize the close button with a picture. Where to find the link "close"? (in what file ??)

Thanks!
Luis

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
In reply to this post by MartinB
I have this problem too, want to customize the close button with a picture. Where to find the link "close"? (in what file ??)

Thanks!
danilor

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
This is the best option to solve this I could fin here: http://www.shadowbox-js.com/forum.html#nabble-td2974370|a2974370
David

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
Hi, I'm trying to find this solution too.
   It seems the request to solve this problem has been asked several times, but no real solution has ever been posted.

Please let me know if you figured it out.

Thanks,
David
Wizzud

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
(This post was updated on )
In reply to this post by MartinB
Edit (6 Nov 09) : These files will not work with Shadowbox 3.0rc1! Please see this post.

shadowbox.skin2.css , shadowbox.skin2.js

Try including the above 2 files after your standard Shadowbox files (shadowbox.css and shadowbox.js).

All it does is move the (existing) close icon to the top right, and slide it into/out of view when needed.
(Tested FF3, IE7, on Win XP)

There must be a simpler way of making a small change to the skin, rather than having to redefine the entire skin, but I'm blowed if I can see it! Changing just the markup (and css) is straightforward, but any other consequential change to processing within the skin causes problems because of the 'private' functions/variables used within the scope of the default skin.
For example, I just needed to add a couple of lines to 2 of the functions - hideBars() and showBars() - both of which are 'private'. I couldn't do it without replacing the entire skin, which effectively means that the default skin (in the shadowbox.js code) is becomes totally redundant.
If anybody else has any ideas (that don't involve changes to shadowbox.js!) I'd be glad to hear them.
Combine literacy with curiosity and a whole world of information opens up to you
ShadowboxFAN

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
This is DAVID, the original message poster.

I'm am HONORED to have the great Wizzud answer my post.  I've been through this forums top and bottom and learning so much.  I have realized that your user name "Wizzud", you've been "personal heros" to so many people.  You've definitely a personal hero to me too.  I will certainly try the code and let you know!

Thank you so much,
David
ShadowboxFAN

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
Wizzud, your code was as easy to implement  as 1-2-3!  AND it works flawlessly.

------- Added to the HTML file -----------
<link rel="stylesheet" type="text/css" href="shadowbox/shadowbox.skin2.css">
<script type="text/javascript" src="shadowbox/shadowbox.skin2.js"></script>

----------END HTML addition ---------------


I still wish we could add the word "CLOSE" next to the X.

But your fix ALREADY gets me to where I am really happy with the shadowbox application!  Thank you so much!

-David


ShadowboxFAN

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
Also, Tested the code under Apple's Safari Version 4.0.2 (5530.19).  Works perfectly there too!

Many Thanks!
-David
Wizzud

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
In reply to this post by ShadowboxFAN
If you're not too language-conscious, the simplest way to add 'close' is to make a new icon that includes the text 'close' on it; then in the added css, change the width for the close anchor to suit, and increase the title's right margin to allow for it.
Combine literacy with curiosity and a whole world of information opens up to you
ShadowboxFAN

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
Oh!  If it's as easy as that!  (you did all the hard work already).  I'll give it a shot later tonight.

I am not language-conscious at all, only english speakers going to my site.

Thank You Wizzud.

-David
MartinB

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
In reply to this post by Wizzud
Hi Wizzud,

THANKS A LOT for you 2 files !!
It works perfect after this quick update. This is really cool.

I really like Shadowbox, an amazing flexible tool.
However I still don't understand why mister Jackson has not yet set a quick way to put the X on top since so many people want to put it where the users will be looking for.

Anyway, you just brought the finishing touch to this great tool.

Thanks again

MartinB
smallfish

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
i am glade to been here,as i found lots of usefull site here, it's great help
ugg shoes
replica jersey
PhilMayfield

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
In reply to this post by Wizzud
close.png
shadowbox.skin2.css

I went ahead and made the changes to Wizzud's excellent files to add the word 'close'.  



The thing I'm trying to figure out now is how to keep the title caption from overlapping the close button if it gets real long.  Im sure it cant be too terribly difficult, I just didnt have time to play with it at the moment.
Serge D

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
In reply to this post by Wizzud
Do shadowbox.skin2.css , shadowbox.skin2.js still applicable to the current code base?
I am getting an JS error
Steffen

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
In reply to this post by Wizzud
Hi,

there is a different way, that doesn't require changes to any of the shadowbox files (also only manipulates public attributes) that also introduces the text 'Close' next to the close icon. After including the shadowbox script and stylesheet simply change the markup for the shadowbox by using the following javascript code:

Shadowbox.skin.markup='<div id="sb-container">' +
       '<div id="sb-overlay"></div>' +
       '<div id="sb-wrapper">' +
           '<div id="sb-title">' +
               '<a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()">Close</a>' +
               '<div id="sb-title-inner"></div>' +
           '</div>' +
           '<div id="sb-body">' +
               '<div id="sb-body-inner"></div>' +
               '<div id="sb-loading">' +
                   '<a onclick="Shadowbox.close()">{cancel}</a>' +
               '</div>' +
           '</div>' +
           '<div id="sb-info">' +
               '<div id="sb-info-inner">' +
                   '<div id="sb-counter"></div>' +
                   '<div id="sb-nav">' +
                       '<a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a>' +
                       '<a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a>' +
                       '<a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a>' +
                       '<a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a>' +
                   '</div>' +
                   '<div style="clear:both"></div>' +
               '</div>' +
           '</div>' +
       '</div>' +
   '</div>';

And then adjust the css a little bit:

#sb-title-inner {
  display:inline;
}
#sb-title a {
  display: block;
  float: right;
  height: 16px;
  margin-left: 3px;
  padding-left: 19px;
  cursor: pointer;
}
#sb-nav-close {
  background-image: url(shadowbox-source-3.0b/resources/close.png);
  background-repeat: no-repeat;
  color:#FFFFFF;
}

You may also want to restyle the font of the 'close' link.
So far I've only tested this with IE8.

Steffen
Steffen

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
Okay it must have been late last night, since I over read the part about the straight forward approach in your post and was wondering why nobody had that idea. Sorry about that.
Today I had another idea. Or actually it's the same just done in a different way. I used the onOpen hook to call a function that appends the element with the id 'sb-nav-close' to the element with the id 'sb-title' (I changed the css just like in my previous post):

function moveCloseLink()
{
    cb=document.getElementById( 'sb-nav-close' );
    tb=document.getElementById( 'sb-title' );

    if( tb )
        tb.appendChild(cb);
}

Shadowbox.init( {
    onOpen: moveCloseLink
} );
Wizzud

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
Both your solutions are fine ... up to a point. And that point is reached when there is no title for the Shadowbox.
While you have a title, everything is hunk-dory. But as soon as no title is supplied then you lose the close button because Shadowbox decides not to needlessly(?) reveal the empty title bar.
You can, of course, modify the shadowbox source code to remove that decision (it's in a private function) and always reveal the title bar, but that sort of defeats the object of being able to re-skin without changing code.
Combine literacy with curiosity and a whole world of information opens up to you
Serge D

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
In reply to this post by Steffen
@Steffen: Thank you for sample.
I was actually less worried about the button, but rather was looking for more general approach with skins.
I guess Shadowbox.skin.markup method would have worked if SB would not force dimensions explicitly.
My goal is to be able skin the box to look like ThickBox... :)
strillogy

Re: Close Button on top with 3.0b....

Reply Threaded More More options
Print post
Permalink
In reply to this post by Wizzud
I tried this solution and when I try to launch shadowbox in the site nothing happens.  I followed the exact instructions and put everything after the regular .css and .js files.

It appears to have disabled the functionality...When I remove the files everything works fine.

I'm using the latest shadowbox...any ideas?

1 2