dakemz
dakemz

Reputation: 11

Jquery inside Facebox

I have facebox setup and it works. when I load an external page with a tab based navigation (JQuery too) the modal works but the nav doesnt. If it isnt clear I actually want the tabs to be inside the lightbox. And I also have php/mysql running inside the lightbox if that can change anything. Thanks for any help.

Edit=> Sorry about the lack of code here is the code on the page that gets loaded into the facebox:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $('#tabs').tabs();
            });
    </script>
<div id="tabs">
        <ul>
            <li><a href="#tabs-1">Informations</a></li>
            <li><a href="#tabs-2">Factures en attente</a></li>
            <li><a href="#tabs-3">Marché en cours</a></li>
        </ul>

I saw that maybe using Jquery live might help but am unsure as to whether its what I need.

Upvotes: 0

Views: 736

Answers (1)

solidau
solidau

Reputation: 4081

I think i understand, but i don't know enough about facebox. if it loads via AJAX then you will need to use the .live function of jQuery inside of your document ready like this: (on your main page, not the modal page):

$(document).ready(function () {
    $('.modal_box').live('load', function () {
        $('#tabs').tabs();
    });
});

If it loads by iFrame, then you will not need to use .live, however you may consider wrapping the tabs call inside of a document ready like this (inside of the modal page):

$(document).ready(function () {
    $('#tabs').tabs();
});

Upvotes: 1

Related Questions