Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ubezi
web-ausstellung-virtuell.de
Commits
ff0121db
Commit
ff0121db
authored
Mar 22, 2018
by
Jonas Heinrich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start implementing popstate event
parent
204addb7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
js/main.js
js/main.js
+4
-8
No files found.
js/main.js
View file @
ff0121db
...
...
@@ -18,8 +18,6 @@ $('body').on('click','.btn, .nav-item, logo, .video-item', function(e) {
url
=
$this
.
attr
(
"
href
"
);
}
alert
(
url
);
load_page
(
url
);
return
false
;
...
...
@@ -27,14 +25,12 @@ $('body').on('click','.btn, .nav-item, logo, .video-item', function(e) {
});
function
load_page
(
url
)
{
$
(
"
content
"
).
empty
();
$
(
"
content
"
).
hide
().
load
(
url
).
fadeIn
(
'
fast
'
);
//
window.history.pushState(
{href: url}
, '', url);
window
.
history
.
pushState
(
''
,
''
,
url
);
}
window
.
addEventListener
(
'
popstate
'
,
function
(
e
){
if
(
e
.
state
)
load_page
(
e
.
state
.
href
);
});
window
.
onpopstate
=
function
(
event
)
{
load_page
(
location
.
pathname
);
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment