• Create Account

## No more jQuery lightbox for images, plox kthx

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1fastcall22  Moderators

Posted 06 November 2012 - 08:56 PM

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>.

Edited by fastcall22, 06 November 2012 - 09:05 PM.

zlib: eJzVVLsSAiEQ6/1qCwoK i7PxA/2S2zMOZljYB1TO ZG7OhUtiduH9egZQCJH9 KcJyo4Wq9t0/RXkKmjx+ cgU4FIMWHhKCU+o/Nx2R LEPgQWLtnfcErbiEl0u4 0UrMghhZewgYcptoEF42 YMj+Z1kg+bVvqxhyo17h nUf+h4b2W4bR4XO01TJ7 qFNzA7jjbxyL71Avh6Tv odnFk4hnxxAf4w6496Kd OgH7/RxC

### #2fastcall22  Moderators

Posted 10 November 2012 - 03:37 PM

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');
})();


Edited by fastcall22, 21 January 2013 - 10:21 AM.

zlib: eJzVVLsSAiEQ6/1qCwoK i7PxA/2S2zMOZljYB1TO ZG7OhUtiduH9egZQCJH9 KcJyo4Wq9t0/RXkKmjx+ cgU4FIMWHhKCU+o/Nx2R LEPgQWLtnfcErbiEl0u4 0UrMghhZewgYcptoEF42 YMj+Z1kg+bVvqxhyo17h nUf+h4b2W4bR4XO01TJ7 qFNzA7jjbxyL71Avh6Tv odnFk4hnxxAf4w6496Kd OgH7/RxC

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.