PageSourceSearch

https://www.canon.com.cn/Public/Front/style/360route.js

js canon.com.cn collected 2026-10-02 07:35:39 UTC 16,357 bytes, 579 lines download raw bytes

1if($("#360show").val() == 'Y'){
2$(function(){
3	var userAgentInfo = navigator.userAgent.toLowerCase();
4	var Agents = ["android", "iphone",
5		"symbianos", "windows phone",
6		"ipad", "ipod"];
7	var ly=document.referrer; //返回导航到当前网页的超链接所在网页的URL
8	for (var v = 0; v < Agents.length; v++) {
9		if (userAgentInfo.indexOf(Agents[v]) >= 0&&(ly==""||ly==null)) {
10			phone()
11		}else{
12			pc()
13		}
14	}
15	function phone(){
16		var timer360=null;
17		var isLoad=false;
18		function imgend(){
19			$('.opacityroutermain').css('display','none')
20		}
21		function isImgLoad(imgend){
22			    // 查找所有封面图,迭代处理
23			    $('.imgmain img').each(function(){
24			        // 找到为0就将isLoad设为false,并退出each
25			        if(this.height === 0){
26			        	isLoad = false;
27			        	return false;
28			        }
29			    });
30			    // 为true,没有发现为0的。加载完毕
31			    if(isLoad){
32			        clearTimeout(timer360); // 清除定时器
33			        // 回调函数
34			        imgend();
35			    // 为false,因为找到了没有加载完成的图,将调用定时器递归
36			}else{
37				isLoad = true;
38				timer360 = setTimeout(function(){
39			            isImgLoad(imgend); // 递归扫描
40			        },20); 
41			}
42		}
43		isImgLoad(imgend)
44		var imgList=$('.imgmain img').get();
45		var num=0;//第几个图片
46		var timer=null//定时器
47		var timer2=null//初始定时器
48		var speednum=2;//加速度
49		var TorF=true//true开始 false暂停
50		var reversebtn=true;//正反向true为正
51		var Oplay=document.getElementById('play')
52		var Ospeed=document.getElementById('speed')
53		var Ozoom=document.getElementById('zoom')
54		var Oreverse=document.getElementById('reverse')
55		var bok=true//放大镜开关
56		//隐藏
57		$('.opacity360').css('height',$('.banner45').height()+'px');
58		$(window).resize(function(){
59			$('.opacity360').css('height',$('.banner45').height()+'px');
60		})
61
62		$('#360btn').click(function(){
63			$('.opacity360').css('display','block')
64			$('.routemain').css('z-index','15')
65		})
66		$('.closeBtn').click(function(){
67			$('.opacitybig').css('display','none')
68			$('#big').css('display','none')
69			$('.opacity360').css('display','none')
70			$('.routemain').css('z-index','-1')
71			bok=true
72			clearInterval(timer)
73			document.getElementById('imgmain2').onmousemove=null
74			move()
75		})
76		function toremove(num){
77			for(var i=0;i<imgList.length;i++){
78				imgList[i].style.opacity="0"
79				imgList[i].id=''
80			}
81			imgList[num].style.opacity="1"
82			imgList[num].id='green_monster'
83			$('#green_monster').attr('data-big','../images/1.png')
84		}
85
86		toremove(num)
87		move()
88		initplay()
89		var x=''
90		//鼠标移动
91		function move(){
92				function Fnmove(ev){
93					var event=ev.targetTouches[0]
94					if(event.clientX>0&&event.clientX<1600){
95						if(event.clientX-x>5){
96							x=event.clientX
97							if(num==0){
98								num=35
99							}
100							num--
101							toremove(num)
102						}else if(event.clientX-x<-5){
103							x=event.clientX
104							if(num==35){
105								num=0
106							}
107							num++
108							toremove(num)
109						}
110					}
111					var imgurl = $('#green_monster').attr('src')
112					$('#big').html("<img src='"+imgurl+"' class='bigcss'></img>")
113				}
114				function Fnend(){
115					document.getElementById('routemain2').removeEventListener('touchmove',Fnmove,false);
116					document.getElementById('routemain2').removeEventListener('touchend',Fnend,false);
117				}
118				document.getElementById('routemain2').addEventListener('touchmove',Fnmove,false)
119				// document.addEventListener('touchend',Fnend,false)
120				document.setCapture&&document.setCapture();
121				return false;
122		}
123
124		function initplay(){
125			timer2=setInterval(function(){
126				if(num==35){
127					num=0
128					clearInterval(timer2)
129				}
130				toremove(num)
131				num++
132			},0)
133		}
134		//开始播放
135		function play(speed){
136
137			clearInterval(timer)
138			timer=setInterval(function(){
139				document.onmousemove=null
140				document.onmouseup=null
141				if(reversebtn){
142					if(num==35){
143						num=0
144					}
145					num++
146				}else{
147					if(num==0){
148						num=35
149					}
150					num--
151				}
152				toremove(num)
153			},speed)
154		}
155		//点击开始
156		Oplay.onclick=function(){
157			$('.opacitybig').css('display','none')
158			$('#big').css('display','none')
159			bok=true
160			if(TorF){
161				clearInterval(timer)
162				switch(speednum){
163					case 1:
164					play(50);
165					break;
166					case 2:
167					play(100);
168					break;
169					case 3:
170					play(140);
171					break;
172				}
173				TorF=false
174				$('#play').css('background','url(/Public/Front/images/2.png) no-repeat top center')
175				$('#play').css('background-size','100%')
176			}else{
177				clearInterval(timer)
178				TorF=true
179				$('#play').css('background','url(/Public/Front/images/1.png) no-repeat top center')
180				$('#play').css('background-size','100%')
181			}
182		}
183		Ospeed.onclick=function(){
184			$('.opacitybig').css('display','none')
185			$('#big').css('display','none')
186			bok=true
187			speednum++
188			if(speednum>3){
189				speednum=1
190			}
191			switch(speednum){
192				case 1:
193				play(50);
194				break;
195				case 2:
196				play(100);
197				break;
198				case 3:
199				play(140);
200				break;
201			}
202		}
203		Oreverse.onclick=function(){
204			reversebtn=!reversebtn
205		}
206
207		Ozoom.onclick=function(){
208			clearInterval(timer)
209			if(bok==true){
210				var imgurl = $('#green_monster').attr('src')
211				$('.opacitybig').css('display','block')
212				$('#big').css('display','block')
213				$('#big').html("<img src='"+imgurl+"' class='bigcss'></img>")
214				var maxX=$('.imgmain').width()
215				var maxY=$('.imgmain').height()
216				bok=false
217				document.getElementById('imgmain2').onmousemove=function(ev){
218					document.onmousemove=null
219					document.onmouseup=null
220					var x=ev.pageX-$('.imgmain').offset().left
221					var calcx=x/maxX
222					var y=ev.pageY-$('.imgmain').offset().top
223					var calcy=y/maxY
224					
225					if(x>80&&x<maxX-80&&y>110&&y<maxY-80){
226						$('#big').css('left',x-80+'px')
227						$('#big').css('top',y-80+'px')
228						$('.bigcss').css('left',-calcx*870+100+'px')
229						$('.bigcss').css('top',-calcy*870+120+'px')
230					}
231				}
232			}else{
233				document.getElementById('imgmain2').onmousemove=null
234				document.onmousedown=function(){
235					document.onmousemove=function(event){
236						if(event.clientX>200&&event.clientX<1600){
237							if(event.clientX-x>20){
238								x=event.clientX
239								toremove(num)
240								if(num==35){
241									num=0
242								}
243								num++
244							}else if(event.clientX-x<-20){
245								x=event.clientX
246								toremove(num)
247								if(num==0){
248									num=35
249								}
250								num--
251							}
252						}
253						var imgurl = $('#green_monster').attr('src')
254						$('#big').html("<img src='"+imgurl+"' class='bigcss'></img>")
255					}
256					document.onmouseup=function(){
257						document.onmousemove=null
258						document.onmouseup=null
259						document.releaseCapture && document.releaseCapture();
260					}
261					document.setCapture&&document.setCapture();
262					return false;
263				}
264				// var imgurl = $('#green_monster').attr('src')
265				// $('.imgmain').css('display','block')
266				$('.opacitybig').css('display','none')
267				$('#big').css('display','none')
268				bok=true
269			}
270		}
271	}
272	function pc(){
273		var timer360=null;
274		var isLoad=false;
275		function imgend(){
276			$('.opacityroutermain').css('display','none')
277		}
278		function isImgLoad(imgend){
279			    // 查找所有封面图,迭代处理
280			    $('.imgmain img').each(function(){
281			        // 找到为0就将isLoad设为false,并退出each
282			        if(this.height === 0){
283			        	isLoad = false;
284			        	return false;
285			        }
286			    });
287			    // 为true,没有发现为0的。加载完毕
288			    if(isLoad){
289			        clearTimeout(timer360); // 清除定时器
290			        // 回调函数
291			        imgend();
292			    // 为false,因为找到了没有加载完成的图,将调用定时器递归
293			}else{
294				isLoad = true;
295				timer360 = setTimeout(function(){
296			            isImgLoad(imgend); // 递归扫描
297			        },20); 
298			}
299		}
300		isImgLoad(imgend)
301		var imgList=$('.imgmain img').get();
302		var num=0;//第几个图片
303		var timer=null//定时器
304		var timer2=null//初始定时器
305		var speednum=2;//加速度
306		var TorF=true//true开始 false暂停
307		var reversebtn=true;//正反向true为正
308		var Oplay=document.getElementById('play')
309		var Ospeed=document.getElementById('speed')
310		var Ozoom=document.getElementById('zoom')
311		var Oreverse=document.getElementById('reverse')
312		var bok=true//放大镜开关
313		//隐藏
314		$('.opacity360').css('height',$('.banner45').height()+'px');
315		$(window).resize(function() {
316			$('.opacity360').css('height',$('.banner45').height()+'px');
317		});
318
319		$('#360btn').click(function(){
320			$('.opacity360').css('display','block')
321			$('.routemain').css('z-index','15')
322		})
323		$('.closeBtn').click(function(){
324			$('.opacitybig').css('display','none')
325			$('#big').css('display','none')
326			$('.opacity360').css('display','none')
327			$('.routemain').css('z-index','-1')
328			$('#play').css('background','url(/Public/Front/images/1.png) no-repeat top center')
329			$('#play').css('background-size','100%')
330			TorF=true
331			bok=true
332			clearInterval(timer)
333			document.getElementById('imgmain2').onmousemove=null
334			move()
335		})
336		function toremove(num){
337			for(var i=0;i<imgList.length;i++){
338				imgList[i].style.opacity="0"
339				imgList[i].id=''
340			}
341			imgList[num].style.opacity="1"
342			imgList[num].id='green_monster'
343			$('#green_monster').attr('data-big','../images/1.png')
344		}
345
346		toremove(num)
347		move()
348		initplay()
349		var x=''
350		//鼠标移动
351		// function mover(){
352		// 	$(document).mousedown(function(){
353		// 		$(document).mousemove(function(event){
354
355		// 		})
356		// 	})
357		// }
358		function move(){
359			document.getElementById('routemain2').onmousedown=function(event){
360				document.getElementById('routemain2').onmousemove=function(event){
361					if(event.clientX>200&&event.clientX<1600){
362						if(event.clientX-x>20){
363							x=event.clientX
364							if(num==0){
365								num=35
366							}
367							num--
368							toremove(num)
369						}else if(event.clientX-x<-20){
370							x=event.clientX
371							if(num==35){
372								num=0
373							}
374							num++
375							toremove(num)
376						}
377					}
378					var imgurl = $('#green_monster').attr('src')
379					$('#big').html("<img src='"+imgurl+"' class='bigcss'></img>")
380				}
381				document.getElementById('routemain2').onmouseup=function(){
382					document.getElementById('routemain2').onmousemove=null
383					document.getElementById('routemain2').onmouseup=null
384					document.releaseCapture && document.releaseCapture();
385				}
386				document.setCapture&&document.setCapture();
387				 event.preventDefault &&event.preventDefault()
388			}
389		}
390
391		function initplay(){
392			timer2=setInterval(function(){
393				if(num==35){
394					num=0
395					clearInterval(timer2)
396				}
397				toremove(num)
398				num++
399			},0)
400		}
401		//开始播放
402		function play(speed){
403
404			clearInterval(timer)
405			timer=setInterval(function(){
406				document.getElementById('routemain2').onmousemove=null
407				document.getElementById('routemain2').onmouseup=null
408				if(reversebtn){
409					if(num==35){
410						num=0
411					}
412					num++
413				}else{
414					if(num==0){
415						num=35
416					}
417					num--
418				}
419				toremove(num)
420			},speed)
421		}
422		//点击开始
423		Oplay.onclick=function(){
424			$('.opacitybig').css('display','none')
425			$('#big').css('display','none')
426			bok=true
427			if(TorF){
428				clearInterval(timer)
429				switch(speednum){
430					case 1:
431					play(50);
432					break;
433					case 2:
434					play(100);
435					break;
436					case 3:
437					play(140);
438					break;
439				}
440				TorF=false
441				$('#play').css('background','url(/Public/Front/images/2.png) no-repeat top center')
442				$('#play').css('background-size','100%')
443			}else{
444				clearInterval(timer)
445				TorF=true
446				$('#play').css('background','url(/Public/Front/images/1.png) no-repeat top center')
447				$('#play').css('background-size','100%')
448			}
449			
450		}
451		Ospeed.onclick=function(){
452			$('.opacitybig').css('display','none')
453			$('#big').css('display','none')
454			bok=true
455			speednum++
456			if(speednum>3){
457				speednum=1
458			}
459			switch(speednum){
460				case 1:
461				play(50);
462				break;
463				case 2:
464				play(100);
465				break;
466				case 3:
467				play(140);
468				break;
469			}
470			
471			TorF=false
472				$('#play').css('background','url(/Public/Front/images/2.png) no-repeat top center')
473				$('#play').css('background-size','100%')
474		}
475		Oreverse.onclick=function(){
476			reversebtn=!reversebtn
477		}
478
479		Ozoom.onclick=function(){
480			clearInterval(timer)
481			if(bok==true){
482				var imgurl = $('#green_monster').attr('src')
483				$('.opacitybig').css('display','block')
484				$('#big').css('display','block')
485				$('#big').html("<img src='"+imgurl+"' class='bigcss'></img>")
486				var maxX=$('.imgmain').width()
487				var maxY=$('.imgmain').height()
488				bok=false
489				TorF=true
490				$('#play').css('background','url(/Public/Front/images/1.png) no-repeat top center')
491				$('#play').css('background-size','100%')
492				document.getElementById('imgmain2').onmousemove=function(ev){
493					document.getElementById('routemain2').onmousemove=null
494					document.getElementById('routemain2').onmouseup=null
495					var x=ev.pageX-$('.imgmain').offset().left
496					var calcx=x/maxX
497					var y=ev.pageY-$('.imgmain').offset().top
498					var calcy=y/maxY
499					if(x>80&&x<maxX-80&&y>110&&y<maxY-80){
500						$('#big').css('left',x-80+'px')
501						$('#big').css('top',y-80+'px')
502						$('.bigcss').css('left',-calcx*870+100+'px')
503						$('.bigcss').css('top',-calcy*870+120+'px')
504					}
505				}
506			}else{
507				document.getElementById('imgmain2').onmousemove=null
508				document.getElementById('routemain2').onmousedown=function(){
509					document.getElementById('routemain2').onmousemove=function(event){
510						if(event.clientX>200&&event.clientX<1600){
511							if(event.clientX-x>20){
512								x=event.clientX
513								toremove(num)
514								if(num==35){
515									num=0
516								}
517								num++
518							}else if(event.clientX-x<-20){
519								x=event.clientX
520								toremove(num)
521								if(num==0){
522									num=35
523								}
524								num--
525							}
526						}
527						var imgurl = $('#green_monster').attr('src')
528						$('#big').html("<img src='"+imgurl+"' class='bigcss'></img>")
529					}
530					document.getElementById('routemain2').onmouseup=function(){
531						document.getElementById('routemain2').onmousemove=null
532						document.getElementById('routemain2').onmouseup=null
533						document.releaseCapture && document.releaseCapture();
534					}
535					document.setCapture&&document.setCapture();
536					 event.preventDefault &&event.preventDefault()
537				}
538				// var imgurl = $('#green_monster').attr('src')
539				// $('.imgmain').css('display','block')
540				$('.opacitybig').css('display','none')
541				$('#big').css('display','none')
542				bok=true
543			}
544		}
545	}
546})
547}
548$(document).ready(function() {
549  // 使用一个标志位来避免重复添加事件监听器
550  if (!$('body').data('scroll-fix-applied')) {
551    
552    $(window).on('scroll', function() {
553      // 使用 requestAnimationFrame 来优化性能
554      // 它会将我们的代码安排在浏览器下一次重绘前执行,避免布局抖动
555      requestAnimationFrame(function() {
556        var width_sp = $(window).width();
557        
558        // 检查是否满足我们想要修改的条件
559        if ($('.cssss_new').length && width_sp <= 957) {
560          // 1. 获取最新的高度
561          var pro_height = $(".tab_fixed_box").height();
562          
563          // 2. 将高度值设置到CSS变量中
564          document.documentElement.style.setProperty('--fixed-offset-height', pro_height + 'px');
565          
566          // 3. 添加CSS类,让CSS去处理最终的top值
567          $(".cssss_new").addClass("mobile_adjust");
568        } else {
569          // 如果不满足条件(例如窗口宽度变大),则移除CSS类
570          $(".cssss_new").removeClass("mobile_adjust");
571        }
572      });
573    });
574    
575    // 标记已经应用了此修复脚本
576    $('body').data('scroll-fix-applied', true);
577  }
578});
579 // 旋转js结束

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.