Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Link to a pure CSS modal already 'poppedup' Reply To: Link to a pure CSS modal already 'poppedup'

#240353
Beverleyh
Participant

You couldn’t do it with CSS alone, but you could with JavaScript – maybe with a unique hash at the end of the page url?

Link from another page/your share url, in this format = http://my website.com/page.htm#modal1 (the hash value is the same as the checkbox id)

Then put this in the page containing the modal – above </body>;

<script>
if (window.location.hash.substr(1) == 'modal1') { document.getElementById('modal1').checked = true }
</script>

I haven’t tested it but it should work.