This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How do I define different sizes of a modal image within one webpage?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found code at w3schools for opening thumbnails into full-sized modal images that works really well, except that some of the images are very wide panoramas, and the definition I am using for the modal (60% width) does not work well for these wider images, which are very short as a result.  The other images fill the screen vertically at 60% width, but not the panoramas.  How can I create a different definition for the panoramas?  I wanted to post my code but I don't understand the directions for doing so and I am afraid of doing it incorrectly.  I think my question is virtually meaningless without the code.  Thanks for any directions you can provide.  Is there a video tutorial anywhere on how to post your code to this site?

 
Saloon Keeper
Posts: 6046
58
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To post your code just cut-n-paste the code. Then drag the cursor over the code so that it is highlighted. Then click on the 'Code' button just above the edit window. To see if it worked click on the 'Preview' button below the edit window. The code should appear in the preview window with line numbers.
 
Barton Lewis
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.  Here it is.  It's mich longer than the 20 lines of code you recommend in the FAQ, but I stripped out everything that I thought was not essential to the problem and left what I thought was in.  This is my first post.  Trial by error.

 
Carey Brown
Saloon Keeper
Posts: 6046
58
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid you've posted on a "Java" forum. What you posted is  "JavaScript", not "Java" (aside from the annoying name similarities).
 
Barton Lewis
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, silly me, not paying close attention.  Thank you.  I will repost to the correct forum.
 
Barton Lewis
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.  I see that the version of the page I posted uses a height: 70% as opposed to width: 60% definition, as referenced in my post.  Sorry for the error/confusion.  But the problem is the same:  the panorama spills over the edges of the screen while displaying correctly for the other 2 images.  So I need something like height: 50% for the panorama - just not sure how to write the code to get 2 different classes of images.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!