我使用Colorbox從外部(但本地)文件加載某些內容。jQuery colorbox加載除Chrome外的所有本地內容
該內容顯示在除谷歌瀏覽器以外的所有內容中。
與事件處理程序臨客附:
<div id="content">
<p><a id="modal" href="popup.html" target="_blank">link to popup</a></p>
</div>
這是jQuery的:
$(document).ready(function(){
$("#modal").colorbox({
innerHeight:200,
innerWidth:530,
title:false,
transition:"none",
onComplete:function(){
$("#cboxLoadedContent div:first").attr("id", "pop");
}
});
});
和頁面我試圖注入:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Hotels.com</title>
<meta name="title" content="" />
<meta name="keywords" content="Hotels, travel" />
<meta name="author" content="Ryan Pays" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
</head>
<body id="pop">
<div class="wrap">
<div class="section">
<div class="redBar">
<p>Lorem ipsum</p>
</div>
<form id="frmExp" name="frmExp" method="post" action="#">
<fieldset>
<legend>A form</legend>
<ul>
<li>
<input type="radio" id="radYes" name="rdAnswer" value="Yes" />
<label for="radYes">Yes</label>
</li>
<li>
<input type="radio" id="radNo" name="rdAnswer" value="Yes" />
<label for="radNo">No</label>
</li>
<li>
<button type="submit">
<span>Button</span>
</button>
</li>
<li>
<button type="submit">
<span>Bigger button</span>
</button>
</li>
<li>
<button type="submit" class="back">
<span>Back button</span>
</button>
</li>
</ul>
</fieldset>
</form>
</div>
<div class="aside">
<ul>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam placerat aliquet nibh</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam placerat aliquet nibh</li>
</ul>
</div>
</div>
</body>
</html>
使用最新的代碼,但仍然沒有快樂:( – RyanP13 2010-10-11 20:58:28
你有沒有試過這個?http://stackoverflow.com/questions/2216926/jquery-load-ie-ff-and-chrome – Mantar 2010-10-11 21:09:10