2014-02-09 2 views
0

사진을 표시하기 위해 페이지로드시 초기 설정으로 shadowbox를 설정할 수 있었지만 많은 사진을 표시해야하고 섀도 박스 사이트를보고 나서 이것을하는 방법을 찾으십시오. 페이지 HTML : 나는 기능 내장 shadowboxes 함께 할 수있는 방법을 찾을 수 없습니다 그러나 이것은 아주 간단하고 잘 작동합니다초기 페이지로드시 갤러리 갤러리를로드하는 섀도우 박스

<link rel="stylesheet" type="text/css" href="C:\Users\Jason\sitebuilder\sites\UltimateFinishAutoDetailing\files\shadowbox-3.0.3/shadowbox.css"> 
<script type="text/javascript" src="C:\Users\Jason\sitebuilder\sites\UltimateFinishAutoDetailing\files\shadowbox-3.0.3/shadowbox.js"></script> 
<script type="text/javascript"> 
Shadowbox.init(); 
</script> 

<script type="text/javascript"> 
Shadowbox.init({ 
skipSetup: true 
}); 
window.onload = function() { 
Shadowbox.open({ 
content:'images/IMG00255-20110531-1435.jpg', 
    player:  "img", 
    title:  "Before and After- Hyundai Tiburon", 
    height:  400, 
    width:  700 
}); 
}; 
</script> 

답변

2

.

<!DOCTYPE html> 
<html> 
<head> 
    <title>Shadowbox</title> 
</head> 

<link rel="stylesheet" type="text/css" href="shadowbox.css"> 
<style type="text/css"> 
    /* Hide all <a> tags */ 
    a[rel~="shadowbox"]{ 
     display: none; 
    } 
</style> 
<script type="text/javascript" src="shadowbox.js"></script> 
<script type="text/javascript"> 
Shadowbox.init(); 
</script> 

<!-- on page load, fake a click to call shadowbox --> 
<body onload="document.getElementById('first').click();"> 

<!-- put all gallery items like this. Only the first link needs the id "first". --> 
<a href="https://www.google.co.nz/images/srpr/logo11w.png" rel="shadowbox[Gallery]" id="first"></a> 
<a href="https://www.google.co.nz/images/srpr/logo11w.png" rel="shadowbox[Gallery]"></a> 

</body> 
</html> 
+0

멋진 myles! 이걸 넣으면 ... 결과를 알릴 수 있습니다. –

+0

알았어. 이건 내가 orginally 했어 외계인 코드입니다. 이제 어떻게 플레이어를 작게 만들 수 있습니까? height : 400, width : 700 ..... "display"아래에 추가 할 수 있는지 보겠습니다. –

+0

... 작동하지 않았습니다. –