-
Notifications
You must be signed in to change notification settings - Fork 16
/
bd.ui.js
executable file
·61 lines (42 loc) · 1.35 KB
/
bd.ui.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
*************************************************
SEBASTIAN NITU
User Interface Functionality for BaseDemo
Created by Sebastian Nitu
http://www.sebnitu.com
*************************************************
*/
/*-------------------------------------------
When Document is Ready (no conflict mode)
---------------------------------------------*/
(function ($) {
$(document).ready(function () {
$('.demo').each(function () {
var tabs = $(this).find('.tabs a'),
panels = $(this).find('.panel').hide(),
hash = window.location.hash;
$(this).find('.tabs a:first').addClass('active');
$(this).find('.panel:first').show();
tabs.click(function () {
var active = $(this).attr("href");
// Toggle active class
tabs.parent().removeClass('active');
$(this).parent().addClass('active');
// Toggle selected panel
panels.hide();
$(active).show();
// Prevent default behavior
return false;
});
});
var nav = $('.nav'),
footer = $('.footer');
// For some reason IE 8 and below does not like this rule
if ($.browser.msie && ($.browser.version < 9.0) ) { } else {
footer.append('<p>Powered by <a href="https://github.com/sebnitu/BaseDemo">BaseDemo</a>. Code responsibly.</p>');
}
});
})(jQuery);
/*-------------------------------------------
Fin
---------------------------------------------*/