0

大家好,我在 joomla 3 中做一个网站

我想在打开模态窗口时执行一项任务,为此我在模态窗口中显示视图我这样做..

这是要执行的任务的路由器

<?php $link = JRoute::_('index.php?option=com_projects&view=proyectos&task=este&id='. $item->id);?>



<div class="span4">
<a href="#.<?php echo $link; ?>" role="button" class="btn" data-toggle="modal">
<img src="<?php echo JURI::root()?>/<?php echo $item->imagenportada; ?>"/></a>
</div>

现在是模态窗口

    <div id="<?php echo $link ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="myModalLabel">Modal header</h3>
        </div>
        <div class="modal-body">
            <p>One fine body…&lt;/p>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
            <button class="btn btn-primary">Save changes</button>
        </div>
    </div>

但不工作。任何的想法!

4

2 回答 2

1

查看 Twitter Bootstrap 的 JS 和 CSS 是否已加载 http://twitter.github.com/bootstrap/javascript.html#modals

于 2013-02-18T21:07:37.070 回答
0

最后我添加到我的链接

 <a href="#modal"  title="<?php $item->id?>" id="<?php echo $item->id; ?>" role="button" class="picture" data-toggle="modal">

和模态窗口

    <div id="modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="myModalLabel">Modal header</h3>
        </div>
        <div class="modal-body">
            <p>One fine body…&lt;/p>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
            <button class="btn btn-primary">Save changes</button>
        </div>
于 2013-02-19T10:17:54.693 回答