I have Fancybox 2.0 installed on my site, modified slightlyto look like the Facebook image preview box. I want to have a second \"instance\" of Fancybox, but for it to be positi
I don't think it is possible to have two instances of fancybox "at the same time" by default (version 2 and previous). If you are good at jQuery you may try to modify the original script (but it would be like re-inventing the wheel).
The only modal box I have seen doing that is jQuery Tools Overlay - http://jquerytools.org/demos/overlay/multiple.html
yes you can... I did it on my web site..
first fancybox ues..
.fancybox-wrap {
margin: Xpx 0 0 Ypx;
}
to position you box..
to dynamically set the position... you need to do two things... A: add a javascript before document.ready() fuunction B: add a onclick in you hyperlink...
so when somebody click the link ,it will change the css before fancybox appear..
the java script as follow (I get from the web, it is a function to dynamically change CSS value)
function css(selector, property, value) {
for (var i=0; i<document.styleSheets.length;i++) {//Loop through all styles
//Try add rule
try { document.styleSheets[i].insertRule(selector+ ' {'+property+':'+value+'}',
document.styleSheets[i].cssRules.length);
} catch(err) {try { document.styleSheets[i].addRule(selector, property+':'+value);} catch(err)
{}}//IE
}
}
the hyper link example:
<a class="fancybox fancybox.iframe" href="showmybox.html" onclick="css('.fancybox-
wrap', 'margin', '-100px 0 0 250px')">
(this will show you box at up-right corner)