When the app starts it loads the profile view, and I need to start a tour script, the problem is, that I’m doing it with document ready and everytime the page reloads, it runs the script and it should depend on the page you are on.
I couldn’t fully understand what you want to do. But like you need to use an event.
https://framework7.io/docs/view.html#router-api-methods-properties
the problem is that where I’m working, they are using v1.*
the thing is that when the app loads the first time, it shows home, and then it starts a tour of all the items.
the problem is that if you go to another page and refresh, it redirects you to that page, and the jquery script $(document).ready activates the tour on a page that shouldn’t show the home tour.
So I’d have to capture which page is loading and then, depending on the page, to show the corresponding tour.
I looked at the V1 document but I couldn’t see an event that could do what you wanted.
This is a bit complicated but can something like this help you?
you can use f7 v1 pages events;
https://v1.framework7.io/docs/pages.html#page-events
page:afteranimation
Event will be triggered after page (and navbar) animation|
thanks, this was my solution to my problem:
$(document).ready(function(e) {
console.log(window.location)
switch (window.location.href) {
default:
break;
}
}):
for some reason, when the page started, it didn’t react to any of this:
$$(document).on('page:init', '.page[data-page="about"]', function (e) {
console.log('init')
console.log('e',e)
// Do something here when page with data-page="about" attribute loaded and initialized
})
$(document).on('page:init', function (e) {
console.log('init')
console.log('e',e)
// Do something here when page loaded and initialized
})
$(document).on('page:beforeinit', function (e) {
console.log('beforeinit')
console.log('e',e)
// Do something here when page loaded and initialize
})