我想做这个的网站的功能.
http://www.filipealcada.com/film/
上面js 是从这个网站上下载下来的虽然可以用,但我想看看他是怎么实现.

解决方案 »

  1.   

    这是用packer加密的,如想解密也很简单,使用alert输出或使用控件的innerHTML功能。
    var initialFrameWidth='300';var initialFrameHeight='50';var defaultFrameWidth='800';var defaultFrameHeight='400';var framePlaceholder='/flgui/images/shim.gif';function displayLayer(which){if(document.getElementById('popup'+which)){document.getElementById('mask').style.display="block";frames['movieFrame'].location.href=framePlaceholder;document.getElementById('popupContent').innerHTML=document.getElementById('popup'+which).innerHTML;new Effect.Morph('popupContainerInner',{style:'width:'+initialFrameWidth+'px;',duration:0});new Effect.Morph('playerLayer',{style:'opacity:0;height:'+initialFrameHeight+'px;width:'+initialFrameWidth+'px;',duration:0});new Effect.Morph('movieFrame',{style:'height:'+initialFrameHeight+'px;width:'+initialFrameWidth+'px;',duration:0});new Effect.Morph('popupContent',{style:'opacity:0;',duration:0});new Effect.Fade('popupContent2',{duration:0});new Effect.Fade('closePopup',{duration:0});window.setTimeout("displayLayer2('"+which+"')",200)}}function displayLayer2(which){new Effect.Appear('popupContainer',{duration:0});var updateURL=function(){frames['movieFrame'].location.href=movies[which];location.href='#'+(which);new Effect.Morph('popupContent2',{style:'opacity:0;',duration:0,queue:{position:'end',scope:'global2'}});revealDetails(which)}.bind(this);new Effect.Morph('popupContainerInner',{style:'width:'+customWidth[which]+'px;',duration:0.5});new Effect.Morph('playerLayer',{style:'height:'+customHeight[which]+'px;width:'+customWidth[which]+'px;',duration:0.5,queue:{position:'end',scope:'global2'}});new Effect.Morph('movieFrame',{style:'height:'+customHeight[which]+'px;width:'+customWidth[which]+'px;',duration:0,queue:{position:'end',scope:'global2'}});new Effect.Appear('closePopup',{duration:0.2,queue:{position:'end',scope:'global2'}});new Effect.Appear('popupContent',{duration:0.5,queue:{position:'end',scope:'global2'}});new Effect.Appear('playerLayer',{duration:0,afterFinish:updateURL,queue:{position:'end',scope:'global2'}})}function removeLayer(){new Effect.Morph('playerLayer',{style:'opacity:0;',duration:0,queue:'end'});frames['movieFrame'].location.href=framePlaceholder;new Effect.Morph('popupContainerInner',{style:'width:'+initialFrameWidth+'px;',duration:0});new Effect.Morph('playerLayer',{style:'height:'+initialFrameHeight+'px;width:'+initialFrameWidth+'px;',duration:0});new Effect.Morph('movieFrame',{style:'height:'+initialFrameHeight+'px;width:'+initialFrameWidth+'px;',duration:0});document.getElementById('mask').style.display="none";var els=$$('.filmPopup');var el;for(var i=0;i<els.length;i++){el=els[i];el.style.display="none"}location.href='#'}function nextImage(which){frames['movieFrame'].location.href=framePlaceholder;new Effect.Morph('playerLayer',{style:'opacity:0;',duration:0});new Effect.Morph('popupContent',{style:'opacity:0;',duration:0});new Effect.Fade('popupContent2',{duration:0});new Effect.Fade('closePopup',{duration:0});var nextOne=parseInt(arguments[0])+1;playerLayerHeight=parseInt(document.getElementById('playerLayer').style.height);window.setTimeout("nextImage2('"+nextOne+"')",200)}function nextImage2(which){document.getElementById('popupContent').innerHTML=document.getElementById('popup'+which).innerHTML;var updateURL=function(){frames['movieFrame'].location.href=movies[which];new Effect.Morph('popupContent2',{style:'opacity:0;',duration:0,queue:{position:'end',scope:'global2'}});revealDetails(which)}.bind(this);if(playerLayerHeight>customHeight[which]){new Effect.Morph('popupContainerInner',{style:'width:'+customWidth[which]+'px;',duration:0.5});new Effect.Morph('movieFrame',{style:'height:'+customHeight[which]+'px;width:'+customWidth[which]+'px;',duration:0,queue:{position:'end',scope:'global2'}});new Effect.Morph('playerLayer',{style:'height:'+customHeight[which]+'px;width:'+customWidth[which]+'px;',duration:0.5,queue:{position:'end',scope:'global2'}});new Effect.Appear('playerLayer',{duration:0,afterFinish:updateURL,queue:{position:'end',scope:'global2'}});new Effect.Appear('closePopup',{duration:0.2,queue:{position:'end',scope:'global2'}});new Effect.Appear('popupContent',{duration:0.5,queue:{position:'end',scope:'global2'}})}else{new Effect.Morph('popupContainerInner',{style:'width:'+customWidth[which]+'px;',duration:0.5});new Effect.Morph('playerLayer',{style:'height:'+customHeight[which]+'px;width:'+customWidth[which]+'px;',duration:0.5,queue:{position:'end',scope:'global2'}});new Effect.Morph('movieFrame',{style:'height:'+customHeight[which]+'px;width:'+customWidth[which]+'px;',duration:0,queue:{position:'end',scope:'global2'}});new Effect.Appear('playerLayer',{duration:0,afterFinish:updateURL,queue:{position:'end',scope:'global2'}});new Effect.Appear('closePopup',{duration:0.2,queue:{position:'end',scope:'global2'}});new Effect.Appear('popupContent',{duration:0.5,queue:{position:'end',scope:'global2'}})}}function previousImage(which){frames['movieFrame'].location.href=framePlaceholder;new Effect.Morph('playerLayer',{style:'opacity:0;',duration:0});new Effect.Morph('popupContent',{style:'opacity:0;',duration:0});new Effect.Fade('popupContent2',{duration:0});new Effect.Fade('closePopup',{duration:0});var previousOne=parseInt(arguments[0])-1;playerLayerHeight=parseInt(document.getElementById('playerLayer').style.height);window.setTimeout("previousImage2('"+previousOne+"')",200)}function previousImage2(which){document.getElementById('popupContent').innerHTML=document.getElementById('popup'+which).innerHTML;var updateURL=function(){frames['movieFrame'].location.href=movies[which];new Effect.Morph('popupContent2',{style:'opacity:0;',duration:0,queue:{position:'end',scope:'global2'}});revealDetails(which)}.bind(this);if(playerLayerHeight>customHeight[which]){new Effect.Morph('popupContainerInner',{style:'width:'+customWidth[which]+'px;',duration:0.5});new Effect.Morph('movieFrame',{style:'height:'+customHeight[which]+'px;width:'+customWidth[which]+'px;',duration:0,queue:{position:'end',scope:'global2'}});new Effect.Morph('playerLayer',{style:'height:'+customHeight[which]+'px;width:'+customWidth[which]+'px;',duration:0.5,queue:{position:'end',scope:'global2'}});new Effect.Appear('playerLayer',{duration:0,afterFinish:updateURL,queue:{position:'end',scope:'global2'}});new Effect.Appear('closePopup',{duration:0.2,queue:{position:'end',scope:'global2'}});new Effect.Appear('popupContent',{duration:0.5,queue:{position:'end',scope:'global2'}})}else{new Effect.Morph('popupContainerInner',{style:'width:'+customWidth[which]+'px;',duration:0.5});new Effect.Morph('playerLayer',{style:'height:'+customHeight[which]+'px;width:'+customWidth[which]+'px;',duration:0.5,queue:{position:'end',scope:'global2'}});new Effect.Morph('movieFrame',{style:'height:'+customHeight[which]+'px;width:'+customWidth[which]+'px;',duration:0,queue:{position:'end',scope:'global2'}});new Effect.Appear('playerLayer',{duration:0,afterFinish:updateURL,queue:{position:'end',scope:'global2'}});new Effect.Appear('closePopup',{duration:0.2,queue:{position:'end',scope:'global2'}});new Effect.Appear('popupContent',{duration:0.5,queue:{position:'end',scope:'global2'}})}}function displayCaption(which){document.getElementById('captionShower').innerHTML=which}function noCaption(){document.getElementById('captionShower').innerHTML=''}function revealDetails(which){if(document.getElementById('contentArea'+which)){var revealDetails2=function(){new Effect.Appear('popupContent2',{duration:0.5,queue:{position:'end',scope:'global2'}})}.bind(this);document.getElementById('popupContent2').innerHTML=document.getElementById('contentArea'+which).innerHTML;new Effect.SlideDown('popupContent2',{duration:0.5,queue:{position:'end',scope:'global2'}});window.setTimeout(revealDetails2,200)}}function redirectForJS(which){window.location=which}function checkHash(){if(window.location.pathname=='/'){}else{var l=document.location.hash;if(l!=''&&l!='#'){var s=l.split('#');if(s.length>1){displayLayer(parseInt(s[1]))}}}}