【问题标题】:Can anyone help me link my Accordian and Jquery css to a normal page in codeigniter?谁能帮我将 Accordion 和 Jquery css 链接到 codeigniter 中的正常页面?
【发布时间】:2014-05-09 17:30:36
【问题描述】:

当试图将我制作的手风琴和一些 jquery css 链接到 codeigniter 中的普通视图页面时,我已经通过正确的文件夹将它们链接起来,但它似乎不知道它在哪里,有人可以帮忙吗?

jquery 链接很长,因为它贯穿了几个文件夹。

<link href="<?php echo base_url()."css/jquery-ui-1.10.4.custom/css/dark-hive/jquery-ui-1.10.4.custom.css";?> type="text/css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<link href="<?php echo base_url()."css/my_accordion.js";?>"</script>

手风琴

$(document).ready(function() {
console.log("ready to do some jquery");
// $( "p" ).hide(); hide paragraphs
//$( "h2").hide(); // h2 hide
$( "h1" ).click(function() {
      console.log("you clicked a paragraph!");
      $( "p" ).hide(500);

      if (!$(this).hasClass("activeHeading")){ 


                  $(".activeHeading").next().slideUp(1000);
                  $(".activeHeading").removeClass("activeHeading");


                  $(this).next().fadeIn(1000);
                  $(this).addClass("activeHeading");
      } //end of if
  }); //end of click
}); //end of document 

【问题讨论】:

    标签: javascript php jquery css codeigniter


    【解决方案1】:

    尝试在“css”之前添加一个额外的正斜杠。见下文:

    <link href="<?php echo base_url()."/css/jquery-ui-1.10.4.custom/css/dark-hive
    /jquery-ui-1.10.4.custom.css";?> type="text/css" rel="stylesheet">
    <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
    <link href="<?php echo base_url()."/css/my_accordion.js";?>"</script>
    

    【讨论】:

      【解决方案2】:

      如果您的 css 目录在您的应用程序文件夹中,那么 CodeIgniter 的重写规则可能会阻止对文件的访问。

      尝试在代码点火器应用程序根目录的 .htaccess 文件中添加以下行。

      RewriteCond $1 !^(application/css)
      

      所以前几行应该是:

      RewriteEngine on
      RewriteCond $1 !^(index\.php|images|robots\.txt)
      RewriteCond $1 !^(application/css)
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2010-12-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-08-22
        • 1970-01-01
        相关资源
        最近更新 更多