作者JYHuang (夏天到了,冷不起來了說)
看板Web_Design
標題Re: [請益] 類似網路相簿功能
時間Mon Nov 10 00:31:58 2008
我之前的寫法是
<script>
~~
pic_url ='picture_a.jpg';
function popup(){
picture = new Image();
picture.src = pic_url;
_width = picture.width+20;
_height = picture.height+20;
eval ("window.open('"+picture.src+"','',
'width="+_width+",height="+_height+"')");
~~~
</script>
然後在onmouseover的動作時,一併指定pic_url
這樣一來跳出的視窗也能隨著圖片的尺寸變動
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.104.204.13
推 TonyQ:我個人是會比較偏愛light-box之類專業的套件,有質感. :p 11/10 00:42
推 MingJui:推thickbox 11/10 00:50
推 Kelunyang:其實小弟推薦給原本提問的人過了Orz 11/10 01:11