PageSourceSearch

https://dnpw.org/cn/js/main.js

js dnpw.org collected 2026-10-03 23:19:54 UTC 13,427 bytes, 466 lines download raw bytes

1jQuery( document ).ready(function( $ ) {
2"use strict"
3    // ---------- Active Menu ---------- //
4		var pathname = window.location.pathname.match(/[^\/]+$/);
5
6		$('.cr-nav a').each(function() {
7		if ($(this).attr('href') == pathname)
8		{
9			$(this).parents('li').addClass('active');
10		}
11		});
12    // ---------- Active Menu ---------- //
13    // ---------- Preloader ---------- //
14    jQuery(window).load(function() {
15        $("#status").delay(10).fadeOut();
16        $("#preloader").delay(10).fadeOut("slow");
17        $('.parallax-window').parallax();
18    })
19    // ---------- Preloader ---------- //
20
21    // ---------- contact popup ---------- //
22      $('#popup-btn').click(function() {
23        $(this).next().toggle('slow');
24        return false;
25      });
26    // ---------- contact popup ---------- //
27
28    // ---------- News Ticker ---------- //
29    var ticker = $('#ticker'),
30        container = ticker.find('ul'),
31        tickWidth = 1,
32        speed = 0.1, // Control pace
33        distance,
34        timing;
35
36        container.find("li").each(function(i) {
37        tickWidth += $(this, i).outerWidth(true);
38        });
39
40        distance = tickWidth + (ticker.outerWidth() - $('#gameLabel').outerWidth());
41        timing = distance / speed;
42
43        function scrollIt(dist, dur) {
44        container.animate({
45          left: '-=' + dist
46        }, dur, 'linear', function() {
47          container.css({
48            'left': ticker.outerWidth()
49          });
50          scrollIt(distance, timing);
51        });
52        }
53
54        scrollIt(distance, timing);
55
56        ticker.hover(function() {
57        container.stop();
58        }, function() {
59        var offset = container.offset(),
60          newPosition = offset.left + tickWidth,
61          newTime = newPosition / speed;
62        scrollIt(newPosition, newTime);
63    });
64    // ---------- News Ticker ---------- //
65    
66    // ------- Slide Meun ------- //
67    $('.menu-link').bigSlide();
68    // ------- Slide Meun ------- //
69
70    // ------- gallelry slider ------- //
71
72        var realSlider= $("ul#gallery-slider").bxSlider({
73            speed:1000,
74            pager:false,
75            infiniteLoop:false,
76            hideControlOnEnd:true,
77            onSlideBefore:function($slideElement, oldIndex, newIndex){
78            changeRealThumb(realThumbSlider,newIndex);   
79            }
80        });
81            
82        var realThumbSlider=$("ul#gallery-slider-thumb").bxSlider({
83          minSlides: 5,
84          maxSlides: 5,
85          slideWidth: 156,
86          slideMargin: 10,
87          moveSlides: 1,
88          pager:false,
89          speed:1000,
90          infiniteLoop:false,
91          hideControlOnEnd:true,
92          onSlideBefore:function($slideElement, oldIndex, newIndex){
93          }
94        });
95            
96        linkRealSliders(realSlider,realThumbSlider);
97            
98            if($("#gallery-slider-thumb li").length<5){
99              $("#gallery-slider-thumb .bx-next").hide();
100            }
101
102        function linkRealSliders(bigS,thumbS){
103          
104          $("ul#gallery-slider-thumb").on("click","a",function(event){
105          event.preventDefault();
106           
107		   var newIndex=$(this).parent().attr("data-slideIndex");
108
109                bigS.goToSlide(newIndex);
110          });
111        }
112
113        function changeRealThumb(slider,newIndex){
114          var $thumbS=$("#gallery-slider-thumb");
115          $thumbS.find('.active').removeClass("active");
116          $thumbS.find('li[data-slideIndex="'+newIndex+'"]').addClass("active");
117          
118          if(slider.getSlideCount()-newIndex>=4)slider.goToSlide(newIndex);
119          else slider.goToSlide(slider.getSlideCount()-4);
120
121        }
122    // ------- gallelry slider ------- //
123	
124		   
125
126    // ------- auther slider ------- //
127    $('.auther-slider').bxSlider({
128        pagerCustom: '#auther-slider-thumb',
129        controls: false
130    });
131    // ------- auther slider ------- //
132
133    // ------- products slider ------- //
134    $('#product-slides').bxSlider({
135        slideMargin: 10,
136        pagerCustom: '#product-thumbnail',
137        controls: false 
138    });
139    // ------- products slider ------- //
140
141    // ------- trending vertical slider ------- //
142    $('.trending-slider').bxSlider({
143        mode: 'vertical',
144        slideMargin: 20,
145        minSlides: 6,
146        responsive: true,
147        pager: false,
148        controls: false,
149        auto: true,
150        pause:6000
151    });
152    // ------- trending vertical slider ------- //
153
154    // ------- news ticker slider ------- //
155    $('#news-ticker').bxSlider({
156       minSlides: 1,
157       maxSlides: 4,
158       slideWidth: 300,
159       slideMargin: 15,
160       ticker: true,
161	   tickerHover:true,
162	   useCSS:false,
163       speed: 15000
164    });
165    // ------- news ticker slider ------- //
166
167    // ------- banner slider home 2 ------- //
168    $('#banner-news-slider').owlCarousel({
169        loop:true,
170        items: 1,
171        dots: false,
172        autoplay:true,
173        autoplayTimeout:3000,
174        transitionStyle : "fade",
175        nav:false
176    })
177    // ------- banner slider home 2  ------- //
178
179    // ------- slider sidebar widget ------- //
180    $('#post-slider').owlCarousel({
181        loop:true,
182        dots: true,
183        items: 1,
184        autoplay:true,
185        autoplayTimeout:5000,
186        transitionStyle : "fade",
187        nav:false
188    })
189    // ------- slider sidebar widget ------- //
190
191
192    // ------- single post slider ------- //
193    $('#single-post').owlCarousel({
194        loop:true,
195        dots: true,
196        items: 1,
197        autoplay:true,
198        autoplayTimeout:5000,
199        transitionStyle : "fade",
200        nav:false
201    })
202    // ------- single post slider ------- //
203
204    // ------- post of the day slider ------- //
205    $('#post-slider-1').owlCarousel({
206        items:4,
207        loop:true,
208        margin:30,
209        nav:false,
210        dots:true,
211		autoplay:true,
212        responsive:{
213            320:{ items:2, dots:true, nav:false},
214            480:{ items:2, dots:true, nav:false},
215            640:{ items:2},
216            991:{ items:3},
217            1199:{ items:5},
218            1200:{ items:5}
219            
220        }
221    });
222    // ------- post of the day slider ------- //
223
224    // ------- most viewd posts ------- //
225    $('#post-slider-2').owlCarousel({
226        items:3,
227        loop:true,
228        margin:30,
229        dots:true,
230		autoplay:true,
231        responsive:{
232            320:{ items:1, dots:true, nav:false},
233            640:{ items:2},
234            991:{ items:2},
235            1199:{ items:3},
236            1200:{ items:3}
237            
238        }
239    });
240    // ------- most viewd posts ------- //
241
242    // ------- slider sidebar widget ------- //
243    $('#twitter-slider').owlCarousel({
244        loop:true,
245        items: 1,
246        autoplay:true,
247        dots: false,
248        nav: false,
249        autoplayTimeout:5000,
250        transitionStyle : "fade",
251    })
252    // ------- slider sidebar widget ------- //
253
254    // ------- Date Picker ------- //
255    $('#calendar').datepicker({
256        inline: true
257    });
258    // ------- Date Picker ------- //
259
260    // ------- social icon expand ------- //
261    $('.share-icon').on('click', function (e) {
262        $('.blog-social').toggleClass("active");
263    });
264    // ------- social icon expand ------- //
265
266    // ------- coming soon timer ------- //
267   // $('#comming-countdown').countdown({
268     //   date: '10/5/2030 13:41:59',
269       // offset: -100,
270        //day: 'Day',
271        //days: 'Days'
272        //}, function() {
273          //  alert('Done!');
274    //});
275    // ------- coming soon timer ------- //
276
277    // ------- google map ------- //
278    //$("#map,#map2").gmap3({
279    //    marker: {
280    //        address: "Haltern am See, Weseler Str. 151"
281    //    },
282    //    map: {
283    //        options: {
284    //            zoom: 10,
285    //            scrollwheel: false,
286    //        }
287    //    },
288    //});
289    // ------- google map ------- //
290
291    // ------- Sticky Smooth Scroll ------- //
292    $('a[href="basics"]').on('click', function(){
293        $('html, body').animate({
294            scrollTop: $( $.attr(this, 'href') ).offset().top
295        }, 1000);
296        return false;
297    }); 
298    // ------- Sticky Smooth Scroll ------- //
299
300    // ------- Prety Photo ------- //
301    $("a[data-rel]").each(function () {
302    	$(this).attr("rel", $(this).data("rel"));
303    });
304    $("a[data-rel^='prettyPhoto']").prettyPhoto({
305    	animation_speed: 'normal',
306    	theme: 'dark_square',
307    	slideshow: 3000,
308    	autoplay_slideshow: false,
309    	social_tools: false
310    });
311    // ------- Prety Photo ------- //
312
313    // ------- autoheight function ------- //
314    var setElementHeight = function() {
315    var height = $(window).height();
316      $('.fullscreen').css('height', (height));
317    }
318    $(window).on("resize", function() {
319      setElementHeight();
320    }).resize();
321    // ------- autoheight function ------- //
322
323    // ------- quantity box ------- //
324    if ($('.quantity').length > 0) {
325        var form_cart = $('.quantity');
326        form_cart.prepend('<span class="minus"><i class="fa fa-minus"></i></span>');
327        form_cart.append('<span class="plus"><i class="fa fa-plus"></i></span>');
328
329        var minus = form_cart.find($('.minus'));
330        var plus = form_cart.find($('.plus'));
331
332        minus.on('click', function() {
333            var qty = $(this).parent().find('.qty');
334            if (qty.val() <= 1) {
335                qty.val(1);
336            } else {
337                qty.val((parseInt(qty.val(), 10) - 1));
338            }
339        });
340        plus.on('click', function() {
341            var qty = $(this).parent().find('.qty');
342            qty.val((parseInt(qty.val(), 10) + 1));
343        });
344    }
345    // ------- quantity box ------- //
346
347    // ------- custom scroll ------- //
348    $('.btn-cart').on('click', function(){
349        if (!$('body').hasClass('cartScroll')){
350            setTimeout(function(){
351              $(".cart-list").mCustomScrollbar({
352                setHeight: '240px'
353              });
354          $('body').addClass('cartScroll');
355          }, 100);
356        }
357    });
358    $(window).load(function(){            
359        $("#custom-scroll").mCustomScrollbar({
360            theme:"minimal",
361            setHeight: '240px'
362        });
363    });
364    // ------- Custom Scroll Bar ------- //
365
366
367    // ------- Scroll to Top ------- //
368    $(window).scroll(function () {
369        if ($(this).scrollTop() > 1000) {
370            $('#scrollup').fadeIn();
371        } else {
372            $('#scrollup').fadeOut();
373        }
374    });
375    $('#scrollup').on('click', function () {
376        $("html, body").animate({
377            scrollTop: 0
378        }, 1000);
379        return false;
380    });
381    // ------- Scroll to Top ------- //
382	if ( $('.grid').length ){
383		// init Isotope
384			var $grid = $('.grid').isotope({
385			  itemSelector: '.grid-item'
386			});
387			// layout Isotope after each image loads
388			$grid.imagesLoaded().progress( function() {
389			  $grid.isotope('layout');
390			});		
391	}
392	// ------ ToolTip ------ //
393	$('[data-toggle="tooltip"]').tooltip()
394});
395
396// ------- clock ------- //
397    function clock(){
398   
399        if (document.getElementById('clock') != null) {
400            var todayDate = new Date();
401            var hours2 = todayDate.getHours();
402            var minutes2 = todayDate.getMinutes();
403            var seconds2 = todayDate.getSeconds();
404        
405            if (hours2 >= 12){meridiem = " PM";}
406            else {meridiem = " AM";}
407
408       
409            if (hours2>12){hours2 = hours2 - 12;}
410            else if (hours2===0){hours2 = 12; }
411       
412            if (minutes2<10){minutes2 = "0" + minutes2;}
413            else {minutes2 = minutes2;}
414
415            if (seconds2<10){seconds2 = "0" + seconds2;}
416            else {seconds2 = seconds2;}
417
418            document.getElementById("clock").innerHTML = ("TIME" + " " + hours2 + ":" + minutes2 + ":" + seconds2 + meridiem);
419        }
420    }
421    setInterval('clock()', 1000);
422// ------- clock ------- //
423
424//----------------------------会员登录------------------------------------
425
426$("#email-id").blur(function(){
427    var email_id = $(this).val();
428    if (email_id != "" && email_id == $(this).attr("ph")) email_id = "";
429    if(!email_id || email_id==""){
430        $(".ts_denglu").html(lang.a5);
431    }
432}).focus(function(){
433    $(".ts_denglu").html("");
434});
435$("#password").blur(function(){ //密码输入框
436    var password=$(this).val();
437    if(!password || password==""){
438        $(".ts_denglu").html(lang.a6);
439    }else if(password.length<5){
440        $(".ts_denglu").html(lang.a3);
441    }
442}).focus(function(){
443    $(".ts_denglu").html("");
444}).keyup(function (event) {
445    if (event.keyCode == 13) {
446        $("#deng-lu").click();
447    }
448});
449  $("#deng-lu").click(function () {
450        var email_id = $("#email-id").val();
451        var password = $("#password").val();
452        if (email_id && password && email_id != "" && password != "") {
453            // 0成功 1:未激活 2:被停用 3:账号或密码错误 4:错误次数过多:15分钟后再试 5:密码错误,您还有两次输入机会
454            $.post("./index.php?c=Login&a=check",{"account":email_id,"pwd":password},function(result){
455				result = $.parseJSON(result);
456				if(result.error == 0){
457					window.location.href = "./index.php?c=Account&a=index";
458				}else{
459					alert(result.msg);
460					$(".ts_denglu").html(result.msg);
461				}
462            });
463        } else {
464            $(".ts_denglu").html(lang.a18);
465        }
466    });

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.