【问题标题】:dijit.layout.ContentPane shifts right on page loaddijit.layout.ContentPane 在页面加载时向右移动
【发布时间】:2015-07-12 08:28:35
【问题描述】:

我有一个无法解决的问题,也许有人可以帮忙?

我的页面顶部有一个 dijit.layout.ContentPane,它位于 dijit.layout.BorderContainer 中。在页面加载容器的内容时​​向右和向下移动大约 15 像素。所有其他元素都可以正常工作。

我已将问题隔离到 dijit.layout.ContentPane。在容器中,我正在运行一些 php if 语句并绘制一些简单的按钮:

<!-- Here are the common buttons above the tabs -->

<div id="toolPane" dojoType="dijit.layout.ContentPane" region="top" >

    <?php 
    if($this->restrict == 1){
        if($this->teammembers == 1 || $this->newleaders == 1 || $this->newadminleaders == 1){ 
            if ($this->mayUpdateSummary){
    ?><span style="white-space:nowrap;" ><?php echo $this->issueActionLink($issue, 'Create report', 'report', 'reportLink'); ?></span>
    <span style="white-space:nowrap;" ><a class="emailLink" href="mailto:?subject=Task%20%23<?php echo $issue->id; ?>&body=<?php echo urlencode($this->serverUrl(true)); ?>">Share link</a></span><?php
    }
    }
    }else if($this->restrict == 2){
        if ($this->mayUpdateSummary){
    ?><span style="white-space:nowrap;" ><?php echo $this->issueActionLink($issue, 'Create report', 'report', 'reportLink'); ?></span>
    <span style="white-space:nowrap;" ><a class="emailLink" href="mailto:?subject=Task%20%23<?php echo $issue->id; ?>&body=<?php echo urlencode($this->serverUrl(true)); ?>">Share link</a></span><?php
    }
    }
    ?>

<?php if ($this->mayUpdateSummary): ?>
<span style="white-space:nowrap;" ><?php echo $this->issueActionLink($issue,'Edit summary', 'progress-summary', 'editbutton'); ?></span> 
<?php endif; ?>
<?php if ($closeButton): ?>
<span style="white-space:nowrap;" ><?php echo $closeButton; ?></span>
<?php endif; ?>
<?php if ($reopenButton): ?>
<span style="white-space:nowrap;" ><?php echo $reopenButton; ?></span>
<?php endif; ?>

</div>

【问题讨论】:

  • 你能设置一个 jsfiddle 让我们看到问题吗?
  • 我认为 php 部分不能在 jsfiddle 上工作,@ccoles3 你能用你的静态 HTML 创建 jsfiddle 吗?

标签: dojo dijit.form dijit.layout


【解决方案1】:

好的,我们决定在加载 dijit 元素之前隐藏页面。为此,我们添加了这个在页面中淡入淡出的脚本,让它有时间在显示之前对其进行排序:

<script type="text/javascript">
    $(document).ready(function(){
        $(".content").hide();
     });

    $(window).load(function(){
        $(".content").fadeIn("fast");
     });
</script>

<div class="content">
[faded in content goes here]
</div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-30
    • 1970-01-01
    • 2012-10-20
    • 2013-10-13
    • 1970-01-01
    相关资源
    最近更新 更多