No more jQuery lightbox for images, plox kthx

Started by
0 comments, last by fastcall22 11 years, 5 months ago

img.bbc_img {
cursor: pointer;
}


A true story:
[attachment=12125:dumb.png]

"This image must be a link because my cursor icon is changed to that of typical text links," says I.
"Oh, you're trying to open this image in another tab with middle-click?" says lightbox, "cool story bro! Mind if I just chill?"
"Okay, so middle-clicking doesn't work, let's try 'Open link in new tab' from the context menu"
"Haha, nope. You mad, bro? Why have the context menu, when you obviously want to see the image in a slow-to-animate popup window!"
"Gah, why did it do that?! This behavior is unexpected and unwanted!", says the increasingly frustrated user that is me, "-- okay, fine, whatever. I'll examine the image in this dumb little window."

(A short time later:)
"Okay, I need to examine the pixels of this image by zooming in..."
"Foolish mortal! Do you think that because this image is in the foreground and is focused, that you are in your browser's 'image viewer mode'? Are you so blind as to my own awesomeness that you forgot that there is still the web page in the background? You will scale the entire page," taunts lightbox!
"Uhh, okay. So instead of zooming in just the image, I have also scaled the web page in the background and moved the box containing the image offscreen."

(Much later:)
"There are a series of images I would like to download in parallel such that I by the time I am finished viewing the first image, the other images will be ready for viewing"
"Nope! You can only look at one image at a time!"
"What!"
"And you have to suffer through the animation between each one! *Evil laughter*!"

(Today:)
"I cannot take it anymore! Thread after thread of image attachments, and the same thing over and over! I must exact let my rage be known throughout 'GDNet Comments, Suggestions and Ideas' such that others may feel my pain! This excessively large image, when previewed, should demonstrate everything that makes lightbox inappropriate for for images!"

TLDR:
Lightbox makes plain-ol' images behave as links, when they aren't. If they are links, then middle-click and right-click should behave as regular links should. Call me old-fashioned, but I miss <a href="link_to_larger_image"><img thumbnail/></a>.
Advertisement
Okay, I've made a greasemonkey script that seems to work on a variety of sites...
(function(){
    var $ = unsafeWindow.jQuery;
    if ( !$ )
        return;
    $('*[rel*=lightbox] img').each(function(){
        var a = $('<a>').attr('href',$(this).attr('src'));
        a.insertBefore($(this));
        $(this).detach();
        a.append($(this));
    });
    $('.lightview').removeClass('lightview');
    $('*[rel*=lightbox]').removeAttr('rel');
})();

This topic is closed to new replies.

Advertisement