87,990
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript">
$(document).ready(function(){
$("a[rel='example1']").colorbox();
});
</script>
<p><a href="ohoopee1.jpg" rel="example1" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<div style="display:none">
<p><a href="ohoopee2.jpg" rel="example1" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a href="ohoopee3.jpg" rel="example1" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
</div>
$("#abc").mouseover(function () {
$("#abc").attr("rel", "example1");
});
$("#abc").click(function () {
$("a[rel='example1']").colorbox();
});
<script type="text/javascript">
$(document).ready(function () {
$("#abc").click(function () {
$("a[rel='example1']").colorbox();
});
$("a[rel='example1']").colorbox();
$("#abc").mouseover(function () {
$("#abc").attr("rel", "example1");
});
});
</script>
<html>
<head>
<title>测试</title>
<link media="screen" rel="stylesheet" href="colorbox.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="../colorbox/jquery.colorbox.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("a[rel='example1']").colorbox();
$("#abc").mouseover(function () {
$("#abc").attr("rel", "example1");
});
});
</script>
</head>
<body>
<p><a href="../content/ohoopee1.jpg" id="abc" class="a1" rel="111" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<div style="display:none;">
<p><a href="../content/ohoopee2.jpg" rel="example1" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a href="../content/ohoopee3.jpg" rel="example1" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
</div>
</body>
</html>

<a id="test">123</a>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script language="JavaScript">
$('#test').attr('rel','123')
</script>