For usability purposes I have added a custom javascript, for moving the "close" link to the upper right corner, and adding a label.
Unfortunately I was not able to add it as a patch, but I thought it would be a good idea to share it anyway. Perhaps someone else can figure out how to add a "custom options" field or similar.
Javascript (you can put this in a separate file in you theme folder):
$(document).ready(function() {
function moveCloseLink(){
// Set variables
var sbClose = $('#sb-nav-close');
var sbTitle = $('#sb-title');
// Add the title from the close link to Drupal's t() function
sbClose.attr('title',Drupal.t('Close'));
if(sbTitle) {
// Add a span to sbTitle with Shadowbox close link
// Don't add the text directly to the <a> tag, there is a IE7/8 issue with "filter: .. AlphaImageLoader .."
sbTitle.append('<span id="sb-nav-label">' + sbClose.attr('title') + '</span>').click(function() {Shadowbox.close()});
// Append sbTitle
sbTitle.append(sbClose);
}
}
// Call the function when Shadowbox opens
Shadowbox.options.onOpen = moveCloseLink;
});
CSS:
#sb-nav-label,
#sb-nav-close {
cursor: pointer;
position: absolute;
top: 8px;
right: 0;
}
#sb-nav-label {
color: #fff;
font-size: 75%;
font-weight: bold;
line-height: 115%;
right: 20px;
}
#sb-nav-close {
height: 13px;
width: 13px;
}
Hopefully this saves someone else the time I have spent on this issue. :)
Comments
Comment #1
manfer commentedComment #2
colorado commentedThank you for this!
I did it this way:
added the css to shadowbox.css, and the js to shadowbox.js, both located in the sites/all/libraries/shadowbox folder.
Following is the css I used with the below attached close.png (I replaced the close.png in the same folder with the one attached here.)