如何在弹出窗口中获取代码对齐方式

时间:2016-07-01 10:06:28

标签: html css

此代码复制代码功能。当我点击copycode然后它在弹出窗口中显示代码,但它显示代码但是对齐只有一行...我有正确的对齐.... enter image description here 我的代码显示在输出屏幕下方,请任何人建议我弹出对齐..

php code

<?php 
    $editorDesc = '<pre class="prettyprint tryit linenums">'. htmlspecialchars(isset($outTryEditorTableInfo[$s]['editor_description']) ? $outTryEditorTableInfo[$s]['editor_description'] : '').'</pre>';
    $finalResult = '<div class="ccsp-example" id="contentdiv" itemprop="articleBody" >'.$editorDesc.$tryItHereBtn.'</div><br/>'.$tryittask;
?>

css

<style>
 ol li {
    list-style-type: none;
    counter-increment: list;
    position: relative;
}

ol li:after {
    content: counter(list)"\00a0 \00a0 " ;
    border-right:1px solid #aeaeae;
    position: absolute;
    left: -2.5em;
    width:4%;
    text-align: right;
} 

</style>

JS

<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?autoload=true&amp;skin=sunburst&amp;lang=css" defer="defer"></script>
<script type="text/javascript" language="Javascript">//<![CDATA[
$(document).ready(function () { processCodeBlocks.Initialise('#contentdiv'); });
$(function (){
       $('.oauth').click(function () {
           $this = $(this);
           href = $this.attr('href');
           var myWindow = window.open(href, 'popup',
                       'width=800,height=600,location=0,menubar=0,resizeable=0,scrollbars=0,toolbar=0');
           myWindow.focus();
           var timer = setInterval(function () {
                           if (myWindow.closed) {
                               clearInterval(timer);
                               // window.location.reload(); // May do a POST reload, shows a warning
                               window.location = window.location; // force a GET reload
                           }
                       }, 200);
           return false;
       });
   });

</script>

0 个答案:

没有答案