Skip to main content
Topic: bbc images not resized to full width? (Read 1678 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

bbc images not resized to full width?

Example:
http://www.elkarte.net/community/index.php?topic=1584.msg10205#msg10205
if I click on the image it becomes slightly higher, but the width remains the same... looks a bit unusual to me.
Bugs creator.
Features destroyer.
Template killer.

Re: bbc images not resized to full width?

Reply #1

That one may be an odd-ball ...

The size used in the tag is making the image larger than it really is, all the JS does it set the height/width to auto which should just let it display it in its actual/normal size. 

Depending on what folks use in the tag it could in fact make it shrink when clicked  :o but in general it will allow it to grow in place as generally the tag is used to resize the image smaller.  Only way to prevent that would be to 'fetch' the image to get its real dimensions and then make the size call, well I guess its been fetched since its displayed, so maybe the JS could be tweaked to do nothing if the zoom would actually shrink?

Re: bbc images not resized to full width?

Reply #2

hmm.
The image in the post I linked is originally 1,679px:
http://i.imgur.com/eOxMmDS.png
The problems seems that .bbc_img { sets max-width: 100% to make the image fit the page width, but javascript is not able to (or simply doesn't) override that setting when clicking, so only the height attribs is able to change the size of the image.
Bugs creator.
Features destroyer.
Template killer.

Re: bbc images not resized to full width?

Reply #3

Indeed, OK disregard what I said the first time :P

So it would seem a couple of issues then.  The JS will need to set max-width to none on the click and it also looks like we will need an overflow auto on its parent inner div.   Not sure if we could just add that overflow to the .inner always or if there are potential side effects.

ETA: https://github.com/Spuds/Elkarte/commit/d00e2d437adf8a9a38173c958384dde6e4162501 

Instead of messing with .inner this wraps the image in a div when its clicked, (a div with overflow) ...
The positive of this is that you get the horizontal scroll bar right below the clicked image instead of at the bottom of the post.  The downside is that if the image does not need a Hscroll bar, it will not stay inline but will instead expand on its own line causing a break in the text where it is was located.

Instead of that its just as easy to just add overflow auto to the inner div instead.  The plus is that an image inline will stay inline if it does not need scroll bars, downside is that if it does need a horizontal scroll bar, it will be at the bottom of the post not below the image.

preferences?
Last Edit: June 21, 2014, 08:26:11 pm by Spuds