Knowledge Base support case for Likno Web Modal Windows Builder, abstracted and stripped of all user’s private info.
Initial Email From: Bill
Initial Email Subject: Modal window back button
Support Case Month: September 2012
I have unsuccessfully tried to create back button for when a window opens inside a Modal window. Ideally, the back arrow only shows if there is a previous page within the same modal window. If you follow my example, the modal window either shuts down or become inoperable. Any ideas that I could us on all my modal windows.
Since the following is a new page in the same modal window clicking ”back” closes all modal windows and make future modal windows fail. I found the code on the internet and it obviously does not work correctly. I need it because some pages open inside the same modal window and sometimes a new modal window is opened.
Reply From: Likno Customer Support
Dear Bill,
This happens because the history does not hold JS events such as the opening of a modal window.
When you click on “back” the browser will try to go back in the history of the current (focused) frame/iframe and if this does not have any history then to the history of the parent frame or top page.
This is what happens in your case. When you open a new window with no history and hit “back” you get the history of the top window.
I am afraid that this is too complex for us to resolve and you will just have to wait until modern browsers support JS events in their history.
Finally, as a note, back() & forward() do not require a parameter, while go() does accept a parameter for the destination step relative to the current page. For example “history.go(-1)” is identical to “history.back()”.
Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook – Follow us on Twitter
Tags: back, button, events, frame, history, iframe, jquery, js, modal, modal window, page, parent, previous, website, window