Insert a warning image (or text) to close before starting
Hello.
web design 17
On the index page of my example site (the first page) I have to insert a warning image (or text) to close before starting, such as happens with the acceptance of cookies.
The message must appear only once when opening the site.
After clicking on the message, the site must be opened and then by pressing the back button of the browser the message must not appear.
Anyone have a solution?
1 Attachment(s)
Re: Insert a warning image (or text) to close before starting
It is not a thing you can do natively in an XDA as Xara designs deliver static code.
In the day, you would set up a Cookie.
The new approach is more graceful.
Run this and Preview in a real browser (not Xara's Preview if using an XDA before v17).
:pointAttachment 129081
The first time you view this you will se a stretch image, a block of text, a box and a close button.
Click the button ot just close the browser.
Rerun or press F5 in the browser and all are gone until you press the RESET button.
If you keep pressing F5 you will get one-off view only unill REST is pressed again.
In the browser's Developer Tools (F12) > Application > Local Storage, you will see a section for your URL with a Key of message and a value of seen after opening the page.
This is only removed with an explicit delete action, like the click of the RESET button.
It will remain in the viewer's browser indefinitely otherwise.
Acorn
Re: Insert a warning image (or text) to close before starting
Small change to the X close: javascript: localStorage.setItem("message", "seen"); void $('.banner').hide('slow'); to make it work in FireFox (and still OK elsewhere).
Equally, you can add a Show button to pop-up the Banner: javascript: void $('.banner').show('slow');
Acorn
Re: Insert a warning image (or text) to close before starting
Thanks Acorn. I published a page on http://opencreative.it following your instructions. everything works. thank you!
Re: Insert a warning image (or text) to close before starting
Quote:
Originally Posted by
megapixel51
Thanks Acorn. I published a page on
http://opencreative.it following your instructions. everything works. thank you!
Great to see it works for you.
Acorn