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";
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";
Is something like this, what you are looking for ?
var alink = document.createElement('a');
alink.setAttribute('href', 'stairs.jpg');
alink.setAttribute('rel','facebox');
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' });