PageSourceSearch

https://www.nihonkurdish.or.jp/wp-content/themes/peace/assets/js/functions.js?ver=7.1.3

js nihonkurdish.or.jp collected 2026-10-06 20:12:21 UTC 10,352 bytes, 327 lines download raw bytes

1
2
3
4( function( $ ) {
5
6    jQuery(document).ready(function($) {
7 //js code for mobile menu 
8      // $('.mobile-toggle').on('click', function(e) {
9      //   $('body').toggleClass('open-mobile-menu')
10      // });
11
12      // $('.mobile-menu>ul>li>a,.mobile-menu ul.dropdown-menu>li>a').on('click', function(e) {
13      //   var element = $(this).parent('li');
14      //   if (element.hasClass('open')) {
15      //     element.removeClass('open');
16      //     element.find('li').removeClass('open');
17      //     element.find('ul').slideUp(1500,"swing");
18      //   }
19      //   else {
20      //     element.addClass('open');
21      //     element.children('ul').slideDown(1500,"swing");
22      //     element.siblings('li').children('ul').slideUp(1500,"swing");
23      //     element.siblings('li').removeClass('open');
24      //     element.siblings('li').find('li').removeClass('open');
25      //     element.siblings('li').find('ul').slideUp(1500,"swing");
26      //   }
27      // }); 
28
29
30
31      //mobile menu display
32     $('.mobile-toggle').on('click', function(e) {
33                $('body').addClass('open-mobile-menu')
34            });
35       $('.close').on('click', function(e) {
36                $('body').removeClass('open-mobile-menu')
37            });
38      //mobile drodown menu display
39       $('.mobile-menu-area ul>li>a,.mobile-menu-area ul.mobile-submenu>
39li>a').on('click', function(e) {
40              var element = $(this).parent('li');
41              if (element.hasClass('open')) {
42                element.removeClass('open');
43                element.find('li').removeClass('open');
44                element.find('ul').slideUp(1000,"swing");
45              }
46              else {
47                element.addClass('open');
48                element.children('ul').slideDown(1000,"swing");
49                element.siblings('li').children('ul').slideUp(1000,"swing");
50                element.siblings('li').removeClass('open');
51                element.siblings('li').find('li').removeClass('open');
52                element.siblings('li').find('ul').slideUp(1000,"swing");
53              }
54            }); 
55
56    //menu options
57        var fixed_top = $(".menu-section");
58
59        $(window).on('scroll', function(){
60          
61          if( $(this).scrollTop() > 100 ){  
62            fixed_top.addClass("animated fadeInDown menu-fixed");
63          }
64          else{
65            fixed_top.removeClass("animated fadeInDown menu-fixed");
66          }
67        });
68
69    });
70
71
72    // sticky nav
73    $(window).scroll(function(){
74                if($(this).scrollTop()>40){
75                    $('.primary-menu').addClass("sticky");
76                }
77                else{
78                    $('.primary-menu').removeClass("sticky");
79                }
80            })
81
82} )( jQuery );
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107/*-------------------------- Top Search and Cart -----------------------*/
108jQuery("#site-search a").click(function(e){
109    jQuery('.search-form').addClass('top-search-open');
110    e.stopPropagation();
111    e.preventDefault();
112});
113jQuery(".fa-close").click(function(e){
114    jQuery('.search-form').removeClass('top-search-open');
115    e.stopPropagation();
116    e.preventDefault();
117});
118
119/**  fixed menu.
120--------------------------------------------------------------------------------------------------- */
121var firstMenuHeight = 200;
122var secondMenuHeight = 260;  
123
124jQuery(window).bind('scroll', function () {
125    if (jQuery(window).scrollTop() > firstMenuHeight) {
126        jQuery('#peace-menu').addClass('fixed-on-top');
127    } else {
128        jQuery('#peace-menu').removeClass('fixed-on-top');
129    }
130
131    if (jQuery(window).scrollTop() > secondMenuHeight) {
132        jQuery('#peace-menu').addClass('fix-menu');
133    } else {
134        jQuery('#peace-menu').removeClass('fix-menu');
135    }
136
137});
138
139
140/**  circular countdown.
141--------------------------------------------------------------------------------------------------- */
142function JBCountDown(settings) {
143    var glob = settings;
144   
145    function deg(deg) {
146        return (Math.PI/180)*deg - (Math.PI/180)*90;
147    }
148    
149    glob.total   = Math.floor((glob.endDate - glob.startDate)/86400);
150    glob.days    = Math.floor((glob.endDate - glob.now ) / 86400);
151    glob.hours   = 24 - Math.floor(((glob.endDate - glob.now) % 86400) / 3600);
152    glob.minutes = 60 - Math.floor((((glob.endDate - glob.now) % 86400) % 3600) / 60) ;
153    glob.seconds = 60 - Math.floor((glob.endDate - glob.now) % 86400 % 3600 % 60);
154    
155    if (glob.now >= glob.endDate) {
156        return;
157    }
158    
159    var clock = {
160        set: {
161            days: function(){
162                var cdays = jQuery(".canvas_days").get(0);
163                var ctx = cdays.getContext("2d");
164                ctx.clearRect(0, 0, cdays.width, cdays.height);
165                ctx.beginPath();
166                ctx.strokeStyle = glob.daysColor;
167                
168                ctx.shadowBlur    = 10;
169                ctx.shadowOffsetX = 0;
170                ctx.shadowOffsetY = 0;
171                ctx.shadowColor = glob.daysGlow;
172                
173                ctx.arc(54.5, 54.5, 52.5, deg(0), deg(360 / glob.total * (glob.total - glob.days)));
174                ctx.lineWidth = 5;
175                ctx.stroke();
176                jQuery(".clock_days .val").text(glob.days);
177            },
178            
179            hours: function(){
180                var cHr = jQuery(".canvas_hours").get(0);
181                var ctx = cHr.getContext("2d");
182                ctx.clearRect(0, 0, cHr.width, cHr.height);
183                ctx.beginPath();
184                ctx.strokeStyle = glob.hoursColor;
185                
186                ctx.shadowBlur    = 10;
187                ctx.shadowOffsetX = 0;
188                ctx.shadowOffsetY = 0;
189                ctx.shadowColor = glob.hoursGlow;
190                
191                ctx.arc(54.5, 54.5, 52.5, deg(0), deg(15 * glob.hours));
192                ctx.lineWidth = 5;
193                ctx.stroke();
194                jQuery(".clock_hours .val").text(24 - glob.hours);
195            },
196            
197            minutes : function(){
198                var cMin = jQuery(".canvas_minutes").get(0);
199                var ctx = cMin.getContext("2d");
200                ctx.clearRect(0, 0, cMin.width, cMin.height);
201                ctx.beginPath();
202                ctx.strokeStyle = glob.minutesColor;
203                
204                ctx.shadowBlur    = 10;
205                ctx.shadowOffsetX = 0;
206                ctx.shadowOffsetY = 0;
207                ctx.shadowColor = glob.minutesGlow;
208                
209                ctx.arc(54.5, 54.5, 52.5, deg(0), deg(6 * glob.minutes));
210                ctx.lineWidth = 5;
211                ctx.stroke();
212                jQuery(".clock_minutes .val").text(60 - glob.minutes);
213            },
214            seconds: function(){
215                var cSec = jQuery(".canvas_seconds").get(0);
216                var ctx = cSec.getContext("2d");
217                ctx.clearRect(0, 0, cSec.width, cSec.height);
218                ctx.beginPath();
219                ctx.strokeStyle = glob.secondsColor;
220                
221                ctx.shadowBlur    = 10;
222                ctx.shadowOffsetX = 0;
223                ctx.shadowOffsetY = 0;
224                ctx.shadowColor = glob.secondsGlow;
225                
226                ctx.arc(54.5, 54.5, 52.5, deg(0), deg(6 * glob.seconds));
227                ctx.lineWidth = 5;
228                ctx.stroke();
229        
230                jQuery(".clock_seconds .val").text(60 - glob.seconds);
231            }
232        },
233       
234        start: function(){
235            /* Seconds */
236            var cdown = setInterval(function(){
237                if ( glob.seconds > 59 ) {
238                    if (60 - glob.minutes === 0 && 24 - glob.hours === 0 && glob.days === 0) {
239                        clearInterval(cdown);
240                        
241                        /* Countdown is complete */
242                        
243                        return;
244                    }
245                    glob.seconds = 1;
246                    if (glob.minutes > 59) {
247                        glob.minutes = 1;
248                        clock.set.minutes();
249                        if (glob.hours > 23) {
250                            glob.hours = 1;
251                            if (glob.days > 0) {
252                                glob.days--;
253                                clock.set.days();
254                            }
255                        } else {
256                            glob.hours++;
257                        }
258                        clock.set.hours();
259                    } else {
260                        glob.minutes++;
261                    }
262                    clock.set.minutes();
263                } else {
264                    glob.seconds++;
265                }
266                clock.set.seconds();
267            },1000);
268        }
269    };
270    clock.set.seconds();
271    clock.set.minutes();
272    clock.set.hours();
273    clock.set.days();
274    clock.start();
275}
276
277/**  festival countdown
278--------------------------------------------------------------------------------------------------- */
279jQuery(document).ready(function($){                
280    $('[data-countdown]').each(function() {
281        var $this = $(this), finalDate = $(this).data('countdown');
282        $this.countdown(finalDate, function(event) {
283        $this.html(event.strftime('<div class="hour col-xs-6"><h3>%m</h3><span>months</span></div> <div class="hour min col-xs-6"><h3>%n</h3><span>days</span></div>'));
284        });
285    });
286    $('[data-timecountdown]').each(function() {
287        var $this = $(this), finalDate = $(this).data('timecountdown');
288        $this.countdown(finalDate, function(event) {
289        $this.html(event.strftime('<div class="hour col-xs-6"><h3>%H</h3><span>hour</span></div> <div class="hour min col-xs-6"><h3>%M</h3><span>minitue</span></div>'));
290        });
291    });
292});
293
294/**  boxer.
295--------------------------------------------------------------------------------------------------- */
296jQuery(".boxer").lightbox();
297
298
299/**  preloader.
300--------------------------------------------------------------------------------------------------- */
301// Site Preloader
302jQuery(window).load(function () {
303    jQuery(".loader").fadeOut();
304    jQuery("#preloader").delay(350).fadeOut("slow");
305});
306
307
308 // scrollReveal Init
309    if (screen.width > 966) {
310      jQuery( document ).ready(function() {
311        new WOW().init();
312      });
313    }
314
315
316
317
318
319
320
321
322
323
324
325
326
327

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.