document.write('
\n
找好玉 -- 中国翡翠玉石批发联盟
\n
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: mall/jsapi.php
Line Number: 1
\n
\n
\n
');
//浮动显示
$(function(){
$(window).scroll(function(){
var st = $(document).scrollTop();
if(st>1000) {
$('.mall_data').css({position:'fixed',top:'65px'});
} else {
$('.mall_data').css({position:'static',top:'0px'});
}
});
});
//显示内容
function gia114_news_view_dslide(id, time)
{
var _this = this;
this.w = $('#'+id).width();
this.h = $('#'+id).height();
this.c = 0;
this.src = [];
this.url = [];
this.alt = [];
this.tar = [];
$('#'+id).find('a').each(function(i) {
_this.src.push($(this).find('img')[0].src);
_this.alt.push($(this).find('img')[0].alt);
_this.url.push(this.href);
_this.tar.push(this.target);
});
if(!this.src[0]) return;
if($('#'+id).find('a').size()<2) return;
this.max = this.src.length;
this.htm = '
';
if(this.alt[0]) this.htm += '
';
if(this.alt[0]) this.htm += ''+this.alt[0]+'
';
this.htm += '';
for(var i = 0; i < this.max; i++) {
this.htm += '';
}
this.htm += '
';
$('#'+id).html(this.htm);
if(this.max == 1) return;
this.t;
this.p = 0;
$('#'+id).mouseover(function() {_this.p=1;});
$('#'+id).mouseout(function() {_this.p=0;});
$('#'+id).find('span').each(function(i) {
$(this).mouseover(function() {
_this.slide(i);
});
});
this.slide = function(o) {
if(o == this.c) return;
$('#'+id+'_img').fadeOut(50);
$('#'+id+'_img').attr("src", this.src[o]);
$('#'+id+'_img').fadeIn(200);
$('#'+id+'_url').attr("href", this.url[o] ? this.url[o] : '###');
$('#'+id+'_url').attr("target", this.url[o] ? this.tar[o] : '_self');
$('#'+id+'_no_'+this.c).css({background:'#828A8F'});
$('#'+id+'_no_'+o).css({background:'#FF7E00'});
if(this.alt[0]) $('#'+id+'_alt').html(this.alt[o]);
this.c = o;
}
this.start = function() {
if(this.p) return;
if(this.c == this.max - 1) {
this.slide(0);
} else {
this.slide(this.c+1);
}
}
if(!time) time = 5000;
this.t = setInterval(function() {_this.start();}, time);
this.start(0);
}
new gia114_news_view_dslide('mall_item_silder');