Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Help with simple image overlay

I'm having trouble working this out, i'm thinking it'll use Javascript? Any help at all will be super appreciated

Anyway so on my index I have a question mark button, and I want it so when a user clicks that, instead of an image opening up or trying to download in a new tab I would like the image to be displayed with a little X button to close it, much like the HF alerts tab.
Like this, a simple overlay.

[Image: 2018-08-13_12-24-43.png]

This is what I'm using so far
Code
<a href="metaexample.PNG" target="_blank" title="Click me for an example"><img src="question.png" height="23px"/>

Not really sure how to go about it all. Thanks if anyone can help! I hope it's not too much to ask ✌


Never mind I think I finally got it on this https://www.w3schools.com/howto/tryit.as..._css_modal


Looks like ass though
You'd use CSS:

Find the ID (id="xxx") or the class (class="xxx") of the X-div. Let's say its an ID (we use # for those, and a dot . for classes) and it's id="closemodal". Now the css (needs to be in a .css file or inside <style></style>-tags):
Code
#closemodal {
z-index: 999999
}
z-index 'layers' elements; so elements with a high z-index will be 'above' elements with lower (or default) z-indexes.



--

Sorry, misread your question. You're looking for a modal. I like remodal http://vodkabears.github.io/remodal/ , but if you want a shinier one you can use https://sweetalert2.github.io/
[Image: AAjOYL.gif]
Create a wrapper element (position relative). The first child element is your content. Under the content you place your overlay (position absolute, width/height = 100%). To trigger display you could use JS or advanced CSS selectors, e.g. #wrapper:hover + #popup {} .
(Aug 13, 2018 10:13 AM)Ganja Wrote:  You'd use CSS:

Find the ID (id="xxx") or the class (class="xxx") of the X-div. Let's say its an ID (we use # for those, and a dot . for classes) and it's id="closemodal". Now the css (needs to be in a .css file or inside <style></style>-tags):
Code
#closemodal {
z-index: 999999
}
z-index 'layers' elements; so elements with a high z-index will be 'above' elements with lower (or default) z-indexes.



--

Sorry, misread your question. You're looking for a modal. I like remodal http://vodkabears.github.io/remodal/ , but if you want a shinier one you can use https://sweetalert2.github.io/
Fuck thanks so much! The second link is absolutely perfect for what I need!


Possibly Related Threads...
Thread / Author Replies Views Last Post
by imanobodyJan 2, 2018 10:55 AM 7 168 Jan 2, 2018 10:55 AM
Last Post: Pikzul
by BinaryCoreJul 14, 2017 07:24 AM 0 75 Jul 14, 2017 07:24 AM
Last Post: BinaryCore
by Shashwat7Mar 13, 2015 06:10 AM 1 102 Mar 13, 2015 06:10 AM
Last Post: Squito