tags:

views:

96

answers:

2

Hi all,i want to enable facebox jquery using javascript.

here in normal html

<a href="stairs.jpg" rel="facebox">text</a>

how do in javascript ?something like this?

document.location.href="stairs.jpg";
document.location.rel="facebox";
A: 

Is something like this, what you are looking for ?

var alink = document.createElement('a');
alink.setAttribute('href', 'stairs.jpg');
alink.setAttribute('rel','facebox');
Gaby
A: 

If you want to open a facebox window and populate it with stairs.jpg then you would use the following:

jQuery.facebox({ image: 'stairs.jpg' });
Colonel Sponsz