Commit acbe79bd authored by Taddeus Kroes's avatar Taddeus Kroes

Added basic menu AJAX functionality.

parent f20bc55e
design/* design/*
cache/*
*~ *~
*.swp *.swp
RewriteEngine On
RewriteBase /tcms
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^index\.php
#RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*?)(\?.*)?$ index.php?$1 [L]
#RewriteCond %{QUERY_STRING} !^$
#Redirect ^(.*?)(\?.*)?$ $1
\ No newline at end of file
This diff is collapsed.
(function($) {
var REFRESH_INTERVAL = 100,
url = location.hash.replace(/^#/, ''),
load_content = function(url) {
// Menu active class
$('#menu a[href=#' + url + ']').addClass('active')
.siblings('.active').removeClass('active');
// AJAX call for content
$('#content').load(url);
},
refresh_url = function(new_url) {
if( new_url != url ) {
url = new_url;
load_content(url);
}
},
interval,
reset_interval = function() {
clearInterval(interval);
interval = setInterval(function() {
refresh_url(location.hash.replace(/^#/, ''));
}, REFRESH_INTERVAL);
};
// Default selected link
if( url == '' )
url = location.hash = 'pages';
$('a[href^=#]').live('click', function() {
reset_interval();
refresh_url($(this).attr('href').substring(1));
});
})(jQuery);
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment