From 6f3d0d8645cbba09fd8197d7603a21344c889e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Bakkeli?= Date: Sun, 31 Jul 2011 19:48:01 +0200 Subject: [PATCH] =?UTF-8?q?fikset=20bug=20hvor=20fremsiden=20ble=20lastet?= =?UTF-8?q?=20p=C3=A5=20nytt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- header.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/header.php b/header.php index e4cf8fa..94c0222 100755 --- a/header.php +++ b/header.php @@ -68,6 +68,7 @@ function showUrlModal(href) }, onClose: function (dialog) { + setLocationWithoutScrolling(preModal); dialog.data.slideUp('fast', function () { dialog.overlay.slideUp('fast', function () { @@ -88,6 +89,9 @@ function setLocationWithoutScrolling(location) { var from = $j("body").scrollTop(); if(!from) from = $j("html").scrollTop(); + + if(location.indexOf("#") == -1) location += "#"; + window.location = location; $j("body,html").scrollTop(from); } @@ -130,7 +134,7 @@ $j(".content .post,#header [href]").live('click',function(e) showUrlModal(href); - var href = this.href.substr(); + href = href.substr(); window.location = window.location.href.split("#")[0] + "#" + href; }); $j("#simplemodal-overlay").live('click', function(){