Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Portrait images do not have correct width

 
Rancher
Posts: 4312
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
NOTE:  THE CODE TAGS HAVE REMOVED PARTS OF SOME OF THE HTML STATEMENTS ???
Disabling HTML seems to have fixed it.


I have a html/js/css program for showing a folder of images.  Landscape images are mostly shown correctly.  But when I get to a portrait image its width is too wide and it shows a stretched image.  When I advance to the next image that is landscape it is shown with reduced width. If I then back up the to the portrait image, it is shown with the correct width.
I have several folders of images each of which have their own html file for showing them.  The html file gets the folder name from its name.  The idea being there would be one master source for the html files that could be copied and renamed to provide starting points for each  of the folders with the images.

How can I have the code show the portrait images correctly the first time?

Previous thread on similiar topic:  https://coderanch.com/t/713528/languages/Prevent-portrait-images-overflowing-screen

The html file:

The js file:

The css file:


Some lines from the list of images (LoadImageRefs.js) :

For this list of images, the .html file would be in the same folder as the WorldCruise folder and the images would be in the WorldCruise/jpg folder.
 
Norm Radder
Rancher
Posts: 4312
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now also posted here: https://stackoverflow.com/questions/67876868/problem-displaying-portrait-images-mixed-with-images-in-landscape
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic