www.dsoo5.com Open in urlscan Pro
107.158.150.127  Public Scan

URL: http://www.dsoo5.com/skins/431047/js/ny.js
Submission: On June 23 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

$(".fl .flnr ul li a").hover(function(){
	$(".fl .flnr ul li dl").hide();
    $(this).parents('li').children('dl').show();
},function(){
    
});

$(function(){	

	$(window).scroll(function() {	
	
	//导航浮动↓-----------不需要导航浮动可以注释
		if($(window).scrollTop() >= 80){
			$('.nav').addClass("Topnav"); 
		}else{
			$('.nav').removeClass("Topnav"); 
			}
	//end导航浮动↑
	
			
		if($(window).scrollTop() >= 1600){
			$('.actGotop').fadeIn(300); 
		}else{    
			$('.actGotop').fadeOut(300);    
		}  
	});
	$('.actGotop').click(function(){
		$('html,body').animate({scrollTop: '0px'}, 1500);
	});	

});


window.onload = function(){


    var mySwiper = new Swiper('.swiper-container',{
        pagination: '.pagination',
        loop:true,
        autoplay:5000,
        paginationClickable: true,
        onSlideChangeStart: function(){
            //回调函数
        }
		
    });
	
	$('.arrow-left').on('click', function(e){
    e.preventDefault()
    mySwiper.swipePrev()
  })
  $('.arrow-right').on('click', function(e){
    e.preventDefault()
    mySwiper.swipeNext()
  })


};




 $('ul[t=leftprolist] li div a[class=ShowChilds]').click(function(){
		var obj = $(this).find('dl');
		var list = $(this).parent().siblings('dl');
		var display = $(list).css('display');
		if( display=='none' ){ 
			$(list).css({'display':'block'});
			$(this).html(' - ');
		}
		else{ 
			$(list).css({'display':'none'});
			$(this).html(' + ');
		}
	});

function load_nav(s)
{
	var onav=$('#nav li a');
	var CurPage=s;
	$('#nav li a').each(function(){
		var t=$(this);
		
		if(CurPage==t.attr('t'))
		{
			t.addClass('hover');
		}
		
	});
}



function piczoom()
{
	 $(function(){
	  //$("img.jqzoom").jqueryzoom();
	  $("img.jqzoom").jqueryzoom({
	  xzoom: 300,		//zooming div default width(default width value is 200)
	  yzoom: 300,		//zooming div default width(default height value is 200)
	  offset: 40,		//zooming div default offset(default offset value is 10)
	  position: "right"  //zooming div position(default position value is "right")
	  });

	  });
}

function ajax_action(jso)
{
	var ptext='ptext';
	
	if(jso.flushName)
	{
		ptext=jso.flushName;
	}
	
	var t=$(this);
	jso.param.r=Math.random();
	$.ajax({
		url:jso.url,
		type:jso.type,
		data:jso.param,
		success:function(data){
			$('#'+ptext).html(data);
		},
		error:function(data){
			alert('error:'+data.responseText);
		}
	});
}

function loadevent(jso)
{
	if(typeof(jso.click)=="undefined")
		click='click';
	else
		click=jso.click;
	
	$('a[t='+jso.param.actionAjax+'],input[t='+jso.param.actionAjax+']')[click](function(){
		var t=$(this);
		
		if(typeof(jso.event)!='undefined')
		{
			if(!jso.event(jso,t))//执行验证
			{
				return;	
			}
		}
		
		var url=jso.url;
		
		jso.param.id=t.attr('tid');
		
		ajax_action({url:url,type:jso.type,param:jso.param,flushName:jso.flushName});
	});
}

function loadclick_cartdel(jso)
{
	loadevent({url:jso.url,type:'post',param:{actionAjax:'del'},event:function(){return confirm('确定删除?\n删除后不可恢复。')}});
}

function loadchange_cartnum(jso)
{
	loadevent({url:jso.url,click:'change',type:'post',param:{actionAjax:'num'},event:function(j,o){
		var v=o.val().trim();
		if(v.length==0 || isNaN(v))
		{
			alert('排序值必须是数字或小数');
			return false;
		}
		j.param['num']=v;
		return true;
	}});
}


//----------------------------------------
(function(){
	y=window._={
		get:function(b,c){c=c||document;if(typeof b==="string")b=c.getElementById(b);return b},
		init:function(e,b,d){b=b||{};d=d||{};for(var c in d)e[c]=b[c]||b[c]==0?b[c]:d[c]},
		scroll:function(o)
		{
			o=o||document.documentElement;
			return {w:o.scrollWidth,h:o.scrollHeight}
		},
		client:function(o)
		{
			o=o||document.documentElement;
			return {w:o.clientWidth,h:o.clientHeight}
		}
	};
})();


jQuery.fn.loadthumb = function(options) {
    options = $.extend({
		 _img:'',
		 maxW:100,
		 maxH:100,
		 model:3
    },options);
	
	var src=options._img.attr('src');
	var par=options._img.parent();
	
    var _self = this;
    _self.hide();
    var img = new Image();
    $(img).load(function(){
        imgDem = {};
        imgDem.w  = img.width;
        imgDem.h  = img.height;
        imgDem = $.imgResize({"w": options.maxW ,"h": options.maxH},{"w":imgDem.w,"h":imgDem.h});
        var imgMargins = $.imgCenter({"w": par.width() ,"h": par.height()},{"w":imgDem.w,"h":imgDem.h});
        //options._img.css({width:imgDem.w,height:imgDem.h,marginLeft:imgMargins.l,marginTop:imgMargins.t});
		if(options.model==1 || options.model==3)
			options._img.css({width:imgDem.w,height:imgDem.h});
		if(options.model==2 || options.model==3)
			options._img.css({marginTop:imgMargins.t});//marginLeft:imgMargins.l,
        _self.attr("src", src);
        _self.fadeIn("slow");
    }).attr("src", src);  //.atte("src",options.src)要放在load后面,
    return _self;
}
//重置图片宽度,高度插件 ( parentDem是父元素,imgDem是图片 )
jQuery.imgResize = function(parentDem,imgDem){
    if(imgDem.w>0 && imgDem.h>0){
        var rate = (parentDem.w/imgDem.w < parentDem.h/imgDem.h)?parentDem.w/imgDem.w:parentDem.h/imgDem.h;
        //如果 指定高度/图片高度  小于  指定宽度/图片宽度 ,  那么,我们的比例数 取 指定高度/图片高度。
        //如果 指定高度/图片高度  大于  指定宽度/图片宽度 ,  那么,我们的比例数 取 指定宽度/图片宽度。
        if(rate <= 1){   
            imgDem.w = imgDem.w*rate; //图片新的宽度 = 宽度 * 比例数
            imgDem.h = imgDem.h*rate;
        }else{//  如果比例数大于1,则新的宽度等于以前的宽度。
            imgDem.w = imgDem.w;
            imgDem.h = imgDem.h;
        }
    }
    return imgDem;
}
//使图片在父元素内水平,垂直居中,( parentDem是父元素,imgDem是图片 )
jQuery.imgCenter = function(parentDem,imgDem){
    var left = (parentDem.w - imgDem.w)*0.5;
    var top = (parentDem.h - imgDem.h)*0.5;
    return { "l": left , "t": top};
}



jQuery.fn.imageScroller = function(params){
	
 var p = params || {
  next:"buttonNext",
  prev:"buttonPrev",
  frame:"viewerFrame",
  width:100,
  pm:10,
  child:"a",
  auto:true
 }; 
 var _btnNext = $("#"+ p.next);
 var _btnPrev = $("#"+ p.prev);
 var _imgFrame = $("#"+ p.frame);
 var _width = p.width;
 
 var _child = p.child;
 var _auto = p.auto;
 var _itv;

 _width=_imgFrame.find(_child+":first").width()+p.pm;
 
 var turnLeft = function(){
	
  _btnPrev.unbind("click",turnLeft);
  if(_auto) autoStop();
  
  _imgFrame.animate( {marginLeft:-_width}, 'slow', '', function(){
   _imgFrame.find(_child+":first").appendTo( _imgFrame );
   _imgFrame.css("marginLeft",0);
   _btnPrev.bind("click",turnLeft);
   if(_auto) autoPlay();
  });
 };
 
 var turnRight = function(){
  _btnNext.unbind("click",turnRight);
  if(_auto) autoStop();
  _imgFrame.find(_child+":last").clone().show().prependTo( _imgFrame );
  _imgFrame.css("marginLeft",-_width);
  _imgFrame.animate( {marginLeft:0}, 'slow' ,'', function(){
   _imgFrame.find(_child+":last").remove();
   _btnNext.bind("click",turnRight);
   if(_auto) autoPlay(); 
  });
 };
 
 _btnNext.css("cursor","pointer").click( turnRight );
 _btnPrev.css("cursor","pointer").click( turnLeft );
 
 var autoPlay = function(){
   _itv = window.setInterval(turnLeft, 5000);
 };
 var autoStop = function(){
  window.clearInterval(_itv);
 };
 if(_auto) autoPlay();
};


(function($) {
    $.fn.extend({
    Scroll: function(opt, callback) {
            var sc = new RunScroll({ name: this.attr('id'), line: opt.line, column: opt.column, speed: opt.speed, timer: opt.timer, action:opt.action });
            sc.Run();
        }
    })
})(jQuery);

var __ScrollTimeID={};

function RunScroll(pJso)
{
    _.init(this,pJso,{
			line:1,
			column:1,
			speed:800,
			timer:5000,
			name:'',
			action:'Top'
		});
	
	if(!this.name)
	{
		//alert('Unspecified tagID [name].')
	}
	this.jq=$('#'+this.name);
}

RunScroll.prototype =
{
    Run: function() {

        var _this = this.jq.eq(0); //.find("ul:first");
        var lineH;
        var line;

        if (this.action == 'Top' || this.action == 'Bottom') {
            lineH = _this.find("li:first").height(); //获取行高
            line = this.line ? parseInt(this.line, 10) : parseInt(this.jq.height() / lineH, 10);
        } else {
            lineH = _this.find("li:first").width(); //获取行高
            line = this.line ? parseInt(this.line, 10) : parseInt(this.jq.width() / lineH, 10);
        }

        var speed = this.speed ? parseInt(this.speed, 10) : 500; //卷动速度,数值越大,速度越慢(毫秒)
        var timer = this.timer ? parseInt(this.timer, 10) : 3000; //滚动的时间间隔(毫秒)
        var lineColumn = this.column ? parseInt(this.column, 10) : 1; //每行显示几列

        if (line == 0) line = 1;
        var upHeight = -line * lineH / lineColumn;

        var animateAction;
        var animateAction1;
        switch (this.action) {
            case 'Top':
                animateAction = { marginTop: upHeight };
                animateAction1 = { marginTop: 0 };
                break;

            case 'Bottom':
                animateAction = { marginBottom: upHeight };
                animateAction1 = { marginBottom: 0 };
                break;

            case 'Left':
                animateAction = { marginLeft: upHeight };
                animateAction1 = { marginLeft: 0 };
                break;

            case 'Right':
                animateAction = { marginRight: upHeight };
                animateAction1 = { marginRight: 0 };
                break;
        }

        var scrollUp = function() {

            _this.animate(animateAction, speed, function() {
                for (i = 1; i <= line; i++) {
                    _this.find("li:first").appendTo(_this);
                }
                _this.css(animateAction1);
            });
        }

        //鼠标事件绑定
        _this.hover(function() {
            clearInterval(this.timeID);
        }, function() {
            this.timeID = setInterval(scrollUp, timer);
        }).mouseout();

    }
}

$(function(){

	
	//精品推荐
	$("#viewer").imageScroller({
		next:"next",
		prev:"prev",
		frame:"viewerFrame",
		pm:parseInt($('#viewerFrame').attr('pm')), //间距
		child:"li",
		auto:true//是否自动播放
	});
	
	//垂直居中,等比缩放
	$(function(){
		$('img[t=p1]').each(function(){
			var t=$(this);
			t.loadthumb({
				'_img':t,
				'maxW':t.width(),
				'maxH':t.height(),
				model:3//1:等比缩放 2:垂直居中 3:所有功能
			});
		});
	})
	
	//快速导航
	$("ul[f=scroll1]").Scroll({ line: 1, column: 1, speed: 800, timer: 2000 });
	$("ul[f=scroll2]").Scroll({ line: 5, column: 5, speed: 800, timer: 2000 });
})


var timer = null;
var offset = 2500;
var index = -1;
//大图交替轮换
function slideImage(i){
    var id = 'image_'+ target[i];
    $('#'+ id)
        .animate({opacity: 1}, 800, function(){
            $(this).find('.word').animate({height: 'show'}, 'slow');
        }).show()
        .siblings(':visible')
        .find('.word').animate({height: 'hide'},'fast',function(){
            $(this).parent().animate({opacity: 0}, 800).hide();
        });
}
//bind thumb a
function hookThumb(){    
    $('#thumbs li a')
        .bind('click', function(){
            if (timer) {
                clearTimeout(timer);
            }                
            var id = this.id;            
            index = getIndex(id.substr(6));
            rechange(index);
            slideImage(index); 
            timer = window.setTimeout(auto, offset);  
            this.blur();            
            return false;
        });
}
//bind next/prev img
function hookBtn(){
    $('#thumbs li img').filter('#play_prev,#play_next')
        .bind('click', function(){
            if (timer){
                clearTimeout(timer);
            }
            var id = this.id;
            if (id == 'play_prev') {
                index--;
                if (index < 0) index = 3;
            }else{
                index++;
                if (index > 3) index = 0;
            }
            rechange(index);
            slideImage(index);
            timer = window.setTimeout(auto, offset);
        });
}
//get index
function getIndex(v){
    for(var i=0; i < target.length; i++){
        if (target[i] == v) return i;
    }
}
function rechange(loop){
    var id = 'thumb_'+ target[loop];
    $('#thumbs li a.current').removeClass('current');
    $('#'+ id).addClass('current');
}
function auto(){
    index++;
    if (index > 3){
        index = 0;
    }
    rechange(index);
    slideImage(index);
    timer = window.setTimeout(auto, offset);
}
$(function(){   
 try{
    //change opacity
    $('div.word').css({opacity: 0.85});
    auto();  
    hookThumb(); 
    hookBtn();
 }catch(e){}
    
});