首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >Colorbox - a jQuery lightbox

Colorbox - a jQuery lightbox

作者头像
geovindu
发布2026-06-19 09:33:10
发布2026-06-19 09:33:10
570
举报

http://www.jacklmoore.com/colorbox/

http://www.jacklmoore.com/colorbox/example5/

代码语言:javascript
复制
 <script type="text/javascript" charset="utf-8">
$(document).ready(function() {
/* Automatically resize to content */
var y = $(document.body).height();
var x = $(document).width();
parent.$.colorbox.resize({innerWidth:x, innerHeight:y});

$("#button_cancel").click(function() {
parent.$.colorbox.close();//注:塗聚文
return false;
})
});


</script>

 <button id="button_cancel" type="button">cancel</button>
代码语言:javascript
复制
  <script language="javascript" type="text/javascript">    
			$(document).ready(function(){			
          	$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
          	$(".iframe").colorbox({
				        onOpen:function(){ alert('onOpen: colorbox is about to open'); },
					onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
					onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
					onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }
					onClosed:function(){ alert('關閉窗口'); window.location='Index.aspx';} //關閉時的狀態//注:塗聚文
					});
          	
			$(".callbacks").colorbox({
					onOpen:function(){ alert('onOpen: colorbox is about to open'); },
					onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
					onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
					onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
					onClosed:function(){ alert('onClosed: colorbox has completely closed'); } //關閉時的狀態
				});

			$("#click").click(function(){ 
					$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
			});
          
});
      
    </script> 
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2026-06-17,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档