Trigger tap after window reload
I have a form that's inside of a lightbox and I am trying to cache any user input to sessionStorage before an orientation change / window.location.reload occurs & then retrieve the sessionStorage key/value pairs & put them back into the form inputs afterwards.
- 1) Caching any input - done
- 2) If the form is in a lightbox & in mobile browser, then I need to trigger a tap on the a link: a[data-rel^="lightcase"] after the window reload
- 3) Write the key/values to inputs - mostly written, but need to get #2 working first
For #2 I tried putting this in doc.ready:
- if (lightbox == "true" && sessionStorage.length > 0) {
- console.log('SessionStorage detected');
- $('a[data-rel^="lightcase"]').trigger("singletap"); // using jQuery Touch Events plugin
- }
I'm seeing the console.log but the lightbox doesn't open. Why isn't this working, any thoughts on how to fix?