Copy link to clipboard
Copied
I have an image that is 2200 x 3000 pixels and when I try to show it in a webpage using target="_blank" it works wonderfully and scales to the size of my display. However when I display the same image in my index webpage it opens a widow where it reverts to its native size and overruns the display. I have tried making it "responsive" and every other work around suggested by Dreamweaver and nothing works. I' m havppy with how it shows up on the targeted web site but that can't close by itseld so I don't want to scatter a bunch of new tabs on a viewers browser.
Anybody have any ideas?
Alternatively, has anyone built a blank template that includes a close button that can receive a tag that for an image?
Copy link to clipboard
Copied
Please supply an online link to the page so that we can see what you have done.
Copy link to clipboard
Copied
Alternatively, has anyone built a blank template that includes a close button that can receive a tag that for an image?
By @Peter35508677swvo
Sounds like a page overlay modal would be a better option or does the image specifically have to open in a new pop open window which is seperate from the window in which the onclick event was initiated, for some reason?
Copy link to clipboard
Copied
when I display the same image in my index page it opens a widow where it reverts to its native size...
By @Peter35508677swvo
==========
Identify the CSS selector name for your modal window and add this.
YourModal img {
max-width: 100%;
}
This will constrain modal images to the parent container's size.
Hope that helps. If not, post back with the URL to your online page.
Copy link to clipboard
Copied
Is this what you're attempting to do? See screenshot.
Copy link to clipboard
Copied
It would be better for me to clearly understand your question, or at least your objectives, which my frenchglish doesn't help.
It would seem that you're fine with the page opening in _blank, but that the problem is that each time you open a new image, it generates a new tab. If this is your problem, use a unique target window name, such as foo, or _foo, to name your new target. This way, each new opening will use the same unique window, and therefore the same tab.
By convention, and although not formalized, it's customary to use the generic term _new, but you can just as easily use myPersonalImageViewer, or _myPersonalImageViewer, however, as with every new tab opened, beware of Javascript-related attacks, so it's advisable to minimize them by adding the rel="noopener noreferrer" attribute https://developer.mozilla.org/fr/docs/Web/HTML/Attributes/rel/noopener, https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/noreferrer
Please, feel free to refine your question if necessary !