그림 몰 려 들 기 유동 효과

8716 단어 F#
페이지 를 불 러 올 때 그림 조각 은 상단 에서 아래로 천천히 확장 되 고 페이지 로 딩 이 완 료 된 후에 수축 하여 유동 효 과 를 실현 합 니 다. js 제 어 는 다음 과 같 습 니 다.

var _ivyIDs=window._ivyIDs||"";
var _tmpIvyIDs=window._tmpIvyIDs||"";
var _cntUrl=window._cntUrl||"";
var _state_=0;
var _count_=1;
var __lock__ =0;
var _ivySubmitPage="#";
function _addIvyID(para_loc_ad){
	if(_tmpIvyIDs.indexOf(para_loc_ad+";")>-1){
		return;
	}

	_tmpIvyIDs = _tmpIvyIDs + para_loc_ad + ";";
	_ivyIDs = _ivyIDs + para_loc_ad + ";";
}
function _delIvyID(para_loc_ad){
	if(para_loc_ad != null && para_loc_ad.length>0 && para_loc_ad.indexOf("_")>0){
		if(_tmpIvyIDs.indexOf(para_loc_ad+";")>-1){
			_tmpIvyIDs = _tmpIvyIDs.replace(para_loc_ad+";", "");
		}
		if(_ivyIDs.indexOf(para_loc_ad+";")>-1){
			_ivyIDs = _ivyIDs.replace(para_loc_ad+";", "");
		}
	}
}
function _submitIvyID_impl(){
  __lock__ = 1;
  if (_ivyIDs && _ivyIDs != ""){
    var _ivyIDssend = _ivyIDs;
    _ivyIDs = "";
    try{
       var i2 = document.createElement("script");
       if(i2){
	  var ivydiv = document.getElementById("ivy_div");
	  if(!ivydiv){
	      //var bodys = document.getElementsByTagName("body");
	      //ivydiv = bodys[0];
              ivydiv   =   document.createElement("div");
              ivydiv.id= "ivy_div";
              ivydiv.style.display   =   "none";
              //2009.2.25...apply insertBefore for better compatiable
              //document.body.appendChild(ivydiv);
              document.body.insertBefore(ivydiv, document.body.firstChild);
	  }

	  if (!ivydiv){
    	      try{
                 var i2 = new Image(1,1);
                 i2.src = _ivySubmitPage + _ivyIDssend;
                 i2.onload=function() { _uVoid(); };
              }catch(err0){_addIvyID(_ivyIDssend);}
	  }else{
              //2009.2.25...apply insertBefore for better compatiable
	      //ivydiv.appendChild(i2);
              document.body.insertBefore(i2, document.body.firstChild);
	      var page = _ivySubmitPage + _ivyIDssend + "&state=" + _state_ + "&submitcnt=" + _count_;
	      i2.src = page;
          }
       }
    }catch(err){
        try{
	   var i2 = new Image(1,1);
           i2.src = _ivySubmitPage + _ivyIDssend;
           i2.onload=function() { _uVoid(); };
        }catch(err1){
           _addIvyID(_ivyIDssend);
        }
    }
  }
  if (_cntUrl && _cntUrl != ""){
    var i3 = new Image(1,1);
    i3.src = _cntUrl;
    i3.onload=function() { _uVoid(); };
    _cntUrl ="";
  }
  __lock__ = 0;
}
function _uVoid() { return; }
function _ivyRandom(size){
  try{
    hi_now = new Date();
    hi_id= hi_now.getSeconds() % size;
    return hi_id;
  }catch(err) {
    return 0;
  }
}
function _submitIvyID(){
   if(__lock__!=0){
      window.setTimeout(_submitIvyID,3000);
      return;
   }
   _state_ = 0;
   _count_ = 1;
   _submitIvyID_impl();
}
function _submitIvyID2(){
   if(__lock__!=0){
      window.setTimeout(_submitIvyID2,3000);
      return;
   }
    _state_ = 1;
   _count_ = 1;

   var needDelay= _ivyIDs&&_ivyIDs!="";
   if(needDelay) _addIvyID("35888_41989"); //                
   _submitIvyID_impl();
   if(needDelay) { var d=new Date(); while(new Date()-d<100){} } //  100         ,  Abort
}
function _submitIvyID3(){
   if(__lock__!=0){
      window.setTimeout(_submitIvyID3,3000);
      return;
   }
   _state_ = 0;
   _count_ = 2;
   _submitIvyID_impl();
}
window.onbeforeunload = _submitIvyID2;

var userAgent = navigator.userAgent.toLowerCase();

if(/msie/.test(userAgent) && !/opera/.test(userAgent)){
    document.onreadystatechange = function(){
      if (document.readyState == "complete"){
     	 _submitIvyID3();
      }
    };
}else if(/opera/.test(userAgent) ||/mozilla/.test(userAgent)){
    document.addEventListener( "DOMContentLoaded", _submitIvyID3 , false );
}

function document_write(s) { document.write(s); }
function document_writeln(s) { document.writeln(s); }

//add for show3
var _IVY_AD_MAP_ = new Array();
function struct_IVY_AD_MAP(key, value){

  this.key = key;
  this.value = value;

}

function setLocationAd(key, value){

  for (var i = 0; i < this._IVY_AD_MAP_.length; i++)
  {
    if ( this._IVY_AD_MAP_[i].key === key )
    {
      this._IVY_AD_MAP_[i].value = value;
      return;
    }
  }

  this._IVY_AD_MAP_[this._IVY_AD_MAP_.length] = new struct_IVY_AD_MAP(key, value);

}

function getLocationAd(key,pex)
{
   var tmp = new Array();
   var obj = new Array();
  for (var i = 0; i < this._IVY_AD_MAP_.length; i++)
  {
    if ( this._IVY_AD_MAP_[i].key === key )
    {
      tmp = this._IVY_AD_MAP_[i].value;
	  break;
    }
  }
  if(tmp != null && tmp.length>0){
	var level = tmp[0].level;
	for(var i=0;i<tmp.length;i++){
		if(pex != null && pex>0){
			if(pex>obj.length){
				obj[obj.length] = tmp[i];
				_addIvyID(tmp[i].locationId + "_" + tmp[i].adId);
			}
		}else{
			if(level>tmp[i].level)break;
			obj[obj.length] = tmp[i];
			_addIvyID(tmp[i].locationId + "_" + tmp[i].adId);
			if(level<2)break;
		}
	}
  }
  return obj;
}

ivymap = window.ivymap || {}; //     ,  show4    
function showIvyViaJs(locationId) {
	var _f = undefined;
	var _fconv = 'ivymap[\"'+locationId+'\"]';
	try {
		_f = eval(_fconv);
		if (_f!=undefined) {
			_f();
		}
		/*         
		else {//     
			var _f2 = undefined;
			var _fconv2 = locationId.replace(/\./g,"_IVY_").replace(/-/g,"_IV_Y_");
			try{
				_f2 = eval(_fconv2);
				if (_f2!=undefined){
					_f2();
				}else{
					//alert('no the function.');
					//handle of not ad found
				}
			}catch(e){}
		}/**/
	} catch(e) {
	}
}

/**                   add by yjx **/
//       
var ivyAdList = new Array();
//       ,key-   ,content-    ,href-    ,ivyPara-    ,showCount-       ,linkCss-    
function IvyKeyword(key, content, href, ivyPara, showCount, linkCss){
	this.key = key;
	this.content = content;
	this.href = href;
	this.ivyPara = ivyPara;
	this.showCount = showCount;
	this.tmpCount = 0;
	this.linkCss = linkCss;
}

//        JS  
function showKeyWorkAd(keys, content, href, ivyPara, showCount, linkCss){
	var keyArray=keys.split("|||");
	//alert(keyArray)
	for(var aa=0;aa<keyArray.length;aa++) {
		ivyAdList[ivyAdList.length] = new IvyKeyword(keyArray[aa], content, href, ivyPara, showCount, linkCss);
	}
}

//  inline         
function getContent(adList,keyList,areaKey,area){
	var content = "";//       
	try {
		var isFind = "";
		for(var a=0;a<keyList.length;a++){// area KeyList  
			if(area.indexOf(keyList[a])!= -1){isFind = keyList[a];break;}
		}
		if(isFind == "") isFind = "    ";//      
		areaKey = eval(areaKey);
		var areaFind = "";
		for(var a=0;a<areaKey.length;a++){
			if(areaKey[a] != null && areaKey[a].key == isFind) {areaFind = areaKey[a].value;break;}
		}
		if(areaFind == "") return "";
		for(var a=0;a<adList.length;a++){
			if(adList[a] != null && adList[a].key.indexOf(areaFind) != -1){content = adList[a].value;break;}		
		}
	} catch(e) {
		
	}
	return content;
}

좋은 웹페이지 즐겨찾기