1 | // Jquery with no conflict
|
---|
2 | jQuery(document).ready(function($) {
|
---|
3 |
|
---|
4 | //##########################################
|
---|
5 | // Tweet feed
|
---|
6 | //##########################################
|
---|
7 |
|
---|
8 | $("#tweets").tweet({
|
---|
9 | count: 2,
|
---|
10 | username: "ansimuz"
|
---|
11 | });
|
---|
12 |
|
---|
13 | //##########################################
|
---|
14 | // Slider
|
---|
15 | //##########################################
|
---|
16 |
|
---|
17 | $('#slider').nivoSlider({
|
---|
18 | effect: 'random', // Specify sets like: 'fold,fade,sliceDown'
|
---|
19 | animSpeed: 500, // Slide transition speed
|
---|
20 | pauseTime: 3000, // How long each slide will show
|
---|
21 | startSlide: 0, // Set starting Slide (0 index)
|
---|
22 | controlNav: false // 1,2,3... navigation
|
---|
23 | });
|
---|
24 |
|
---|
25 |
|
---|
26 | //##########################################
|
---|
27 | // Slider - project
|
---|
28 | //##########################################
|
---|
29 |
|
---|
30 | $('#slider-project').nivoSlider({
|
---|
31 | effect: 'random', // Specify sets like: 'fold,fade,sliceDown'
|
---|
32 | animSpeed: 500, // Slide transition speed
|
---|
33 | pauseTime: 3000, // How long each slide will show
|
---|
34 | startSlide: 0, // Set starting Slide (0 index)
|
---|
35 | controlNav: true // 1,2,3... navigation
|
---|
36 | });
|
---|
37 |
|
---|
38 | //##########################################
|
---|
39 | // Tool tips
|
---|
40 | //##########################################
|
---|
41 |
|
---|
42 |
|
---|
43 | $('.poshytip').poshytip({
|
---|
44 | className: 'tip-yellow',
|
---|
45 | showTimeout: 1,
|
---|
46 | alignTo: 'target',
|
---|
47 | alignX: 'center',
|
---|
48 | offsetY: 5,
|
---|
49 | allowTipHover: false
|
---|
50 | });
|
---|
51 |
|
---|
52 |
|
---|
53 |
|
---|
54 | $('.form-poshytip').poshytip({
|
---|
55 | className: 'tip-yellow',
|
---|
56 | showOn: 'focus',
|
---|
57 | alignTo: 'target',
|
---|
58 | alignX: 'right',
|
---|
59 | alignY: 'center',
|
---|
60 | offsetX: 5
|
---|
61 | });
|
---|
62 |
|
---|
63 | //##########################################
|
---|
64 | // Superfish
|
---|
65 | //##########################################
|
---|
66 |
|
---|
67 | $(".sf-menu").superfish({
|
---|
68 | animation: {height:'show'}, // slide-down effect without fade-in
|
---|
69 | delay: 800 , // 1.2 second delay on mouseout
|
---|
70 | autoArrows: false,
|
---|
71 | speed: 100
|
---|
72 | });
|
---|
73 |
|
---|
74 | //##########################################
|
---|
75 | // Accordion box
|
---|
76 | //##########################################
|
---|
77 |
|
---|
78 | $('.accordion-container').hide();
|
---|
79 | $('.accordion-trigger:first').addClass('active').next().show();
|
---|
80 | $('.accordion-trigger').click(function(){
|
---|
81 | if( $(this).next().is(':hidden') ) {
|
---|
82 | $('.accordion-trigger').removeClass('active').next().slideUp();
|
---|
83 | $(this).toggleClass('active').next().slideDown();
|
---|
84 | }
|
---|
85 | return false;
|
---|
86 | });
|
---|
87 |
|
---|
88 | //##########################################
|
---|
89 | // Toggle box
|
---|
90 | //##########################################
|
---|
91 |
|
---|
92 | $('.toggle-trigger').click(function() {
|
---|
93 | $(this).next().toggle('slow');
|
---|
94 | $(this).toggleClass("active");
|
---|
95 | return false;
|
---|
96 | }).next().hide();
|
---|
97 |
|
---|
98 | //##########################################
|
---|
99 | // Tabs
|
---|
100 | //##########################################
|
---|
101 |
|
---|
102 | $(".tabs").tabs("div.panes > div", {effect: 'fade'});
|
---|
103 |
|
---|
104 | //##########################################
|
---|
105 | // Create Combo Navi
|
---|
106 | //##########################################
|
---|
107 |
|
---|
108 | // Create the dropdown base
|
---|
109 | $("<select id='comboNav' />").appendTo("#combo-holder");
|
---|
110 |
|
---|
111 | // Create default option "Go to..."
|
---|
112 | $("<option />", {
|
---|
113 | "selected": "selected",
|
---|
114 | "value" : "",
|
---|
115 | "text" : "Navigation"
|
---|
116 | }).appendTo("#combo-holder select");
|
---|
117 |
|
---|
118 | // Populate dropdown with menu items
|
---|
119 | $("#nav a").each(function() {
|
---|
120 | var el = $(this);
|
---|
121 | var label = $(this).parent().parent().attr('id');
|
---|
122 | var sub = (label == 'nav') ? '' : '- ';
|
---|
123 |
|
---|
124 | $("<option />", {
|
---|
125 | "value" : el.attr("href"),
|
---|
126 | "text" : sub + el.text()
|
---|
127 | }).appendTo("#combo-holder select");
|
---|
128 | });
|
---|
129 |
|
---|
130 |
|
---|
131 | //##########################################
|
---|
132 | // Combo Navigation action
|
---|
133 | //##########################################
|
---|
134 |
|
---|
135 | $("#comboNav").change(function() {
|
---|
136 | location = this.options[this.selectedIndex].value;
|
---|
137 | });
|
---|
138 |
|
---|
139 | //##########################################
|
---|
140 | // Work - Isotope
|
---|
141 | //##########################################
|
---|
142 |
|
---|
143 |
|
---|
144 | var $container = $('#filter-container');
|
---|
145 |
|
---|
146 | $container.imagesLoaded( function(){
|
---|
147 | $container.isotope({
|
---|
148 | itemSelector : 'li',
|
---|
149 | filter: '*',
|
---|
150 | resizable: false,
|
---|
151 | animationEngine: 'jquery'
|
---|
152 | });
|
---|
153 | });
|
---|
154 |
|
---|
155 | // filter buttons
|
---|
156 |
|
---|
157 | $('#filter-buttons a').click(function(){
|
---|
158 |
|
---|
159 | // select current
|
---|
160 | var $optionSet = $(this).parents('#filter-buttons');
|
---|
161 | $optionSet.find('.selected').removeClass('selected');
|
---|
162 | $(this).addClass('selected');
|
---|
163 |
|
---|
164 | var selector = $(this).attr('data-filter');
|
---|
165 | $container.isotope({ filter: selector });
|
---|
166 | return false;
|
---|
167 | });
|
---|
168 |
|
---|
169 | //##########################################
|
---|
170 | // Home - Isotope
|
---|
171 | //##########################################
|
---|
172 |
|
---|
173 |
|
---|
174 | var $container_home = $('#filter-container-feature');
|
---|
175 |
|
---|
176 | $container_home.imagesLoaded( function(){
|
---|
177 | $container_home.isotope({
|
---|
178 | itemSelector : 'li',
|
---|
179 | });
|
---|
180 | });
|
---|
181 |
|
---|
182 |
|
---|
183 | /*
|
---|
184 | * Commented due to relayout issue
|
---|
185 | *
|
---|
186 | // modified Isotope methods for gutters in masonry
|
---|
187 | $.Isotope.prototype._getMasonryGutterColumns = function() {
|
---|
188 | var gutter = this.options.masonry && this.options.masonry.gutterWidth || 0;
|
---|
189 | containerWidth = this.element.width();
|
---|
190 |
|
---|
191 | this.masonry.columnWidth = this.options.masonry && this.options.masonry.columnWidth ||
|
---|
192 | // or use the size of the first item
|
---|
193 | this.$filteredAtoms.outerWidth(true) ||
|
---|
194 | // if there's no items, use size of container
|
---|
195 | containerWidth;
|
---|
196 |
|
---|
197 | this.masonry.columnWidth += gutter;
|
---|
198 |
|
---|
199 | this.masonry.cols = Math.floor( ( containerWidth + gutter ) / this.masonry.columnWidth );
|
---|
200 | this.masonry.cols = Math.max( this.masonry.cols, 1 );
|
---|
201 | };
|
---|
202 |
|
---|
203 | $.Isotope.prototype._masonryReset = function() {
|
---|
204 | // layout-specific props
|
---|
205 | this.masonry = {};
|
---|
206 | // FIXME shouldn't have to call this again
|
---|
207 | this._getMasonryGutterColumns();
|
---|
208 | var i = this.masonry.cols;
|
---|
209 | this.masonry.colYs = [];
|
---|
210 | while (i--) {
|
---|
211 | this.masonry.colYs.push( 0 );
|
---|
212 | }
|
---|
213 | };
|
---|
214 |
|
---|
215 | $.Isotope.prototype._masonryResizeChanged = function() {
|
---|
216 | var prevSegments = this.masonry.cols;
|
---|
217 | // update cols/rows
|
---|
218 | this._getMasonryGutterColumns();
|
---|
219 | // return if updated cols/rows is not equal to previous
|
---|
220 | return ( this.masonry.cols !== prevSegments );
|
---|
221 | };
|
---|
222 | */
|
---|
223 |
|
---|
224 | //##########################################
|
---|
225 | // Resize event
|
---|
226 | //##########################################
|
---|
227 |
|
---|
228 | $(window).resize(function() {
|
---|
229 |
|
---|
230 | var w = $(window).width();
|
---|
231 | //console.log(w);
|
---|
232 |
|
---|
233 | $container_home.isotope('reLayout');
|
---|
234 |
|
---|
235 | }).trigger("resize");
|
---|
236 |
|
---|
237 | }); |
---|