Problemusing facebox with INNER HTML

5 views
Skip to first unread message

raknin

unread,
May 6, 2008, 5:10:28 AM5/6/08
to facebox
Hi,

I have a problem to use the face box with innerHTML The problem is
that I don't know the right place to put, in every place I put it it
doesn't do anything .:

jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
})

this fraction of code. Can anyone advice, My simple code is attached
below.



I use the following code:

[CODE]

<html>

<head>

<title></title>

<script language="javascript" src="js/jquery.js" type="text/
javascript"></script>
<script language="javascript" src="js/facebox.js" type="text/
javascript"></script>
<link rel="stylesheet" type="text/css" href="facebox.css"
media="screen" />

<script language="javascript" type="text/javascript">
function test() {
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
})
var test1=' <a href="image1.jpg" rel="facebox"><img src="image1.jpg"
width="480" height="320" align="absmiddle" alt="Click for larger
picture"></a>';
document.getElementById('picture').innerHTML=test1;
}
</script>
</head>

<body>
<input name="Test" id="Test" type="button" value="Test"
onclick="test();">
<div id="picture"></div>
</body>

</html>

[/CODE}
Reply all
Reply to author
Forward
0 new messages