我有一個畫廊,我希望用戶使用Colorbox打開圖片。 (然後發送郵件或打印它的圖片等)Colorbox和Image Resize
本網站必須動態編程,因爲它必須在iPad上工作。
我們實際的問題:
這個div應該在彩盒中顯示:
<div style = "display:none">
<div id="inline" style="height:100%; width:auto">
<img src="#" id="inline_img" style="max-height:90%; max-width:100%"/>
<div id="buttons">
<button > test </button>
<button > test1 </button>
<button > test2 </button>
</div>
</div>
</div>
而這正是在div的顏色框打開了Javascripit功能。
$(function(){
//$('.element a').colorbox({});
$('.element a').click(function(){
// Using a selector:
$('#inline_img').attr('src',$(this).find("img").attr('src'));
$.fn.colorbox({
inline:true,
href:"#inline",
maxHeight:'90%',
maxWidth:'90%'
});
return false;
});
$('.element a').colorbox({
onComplete : function() {
$(this).colorbox.resize();
}
});
但是Colorbox總是比圖片本身大得多。 Colorbox必須與圖像一樣大,並且位於屏幕中央。
不知道爲什麼這是在php – Markedagain 2012-07-10 21:40:35
刪除php標記。 – MrTouch 2012-07-11 08:47:21