Open Facebox in first access the page

0 views
Skip to first unread message

Solari

unread,
Jul 20, 2008, 2:10:14 AM7/20/08
to facebox
Hello, guys!!

I'm with problem. I want open a content html into facebox in first
access on the page, without to be there is need of the user click on
buttom at open o facebox. I'm not can call function correctly.
Tried several way, for example;

$.facebox('my html','my style')


I nedd help you,

Thank you for all.

Jonny Stephens

unread,
Jul 20, 2008, 8:44:01 AM7/20/08
to facebox
There are instructions for this in the facebox.js file's comments:

* The facebox function can also display an ajax page or image:
*
* jQuery.facebox({ ajax: 'remote.html' })
* jQuery.facebox({ image: 'dude.jpg' })

So, to open content.html on page load you would use the following in
your head (with the correct path to content.html):

<script type="text/javascript">
jQuery(document).ready(function($) {
jQuery.facebox({ ajax: 'content.html' })
})
</script>

Or, if you also require Facebox to be available for triggering by
anchors in the page using rel=:facebox":

<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
jQuery.facebox({ ajax: 'content.html' })
})
</script>
Reply all
Reply to author
Forward
0 new messages