简体   繁体   English

谁能帮助我将Accordian和Jquery CSS链接到codeigniter中的常规页面?

[英]Can anyone help me link my Accordian and Jquery css to a normal page in codeigniter?

When trying to link an accordion that I have made and some jquery css to a normal view page in codeigniter, I have linked them through the right folders but it doesn't seem to know where it is can anyone help? 当尝试将我制作的手风琴和一些jQuery CSS链接到codeigniter中的常规视图页面时,我已经通过正确的文件夹将它们链接起来,但是似乎不知道有人在哪里可以提供帮助?

The jquery link is long because it runs through a few folders. 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>

Accordion 手风琴

$(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 

Try adding an extra forward slash before "css". 尝试在“ css”之前添加一个额外的正斜杠。 See below: 见下文:

<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>

If your css directory is within your application folder then CodeIgniter's rewrite rules may be preventing access to the files. 如果css目录位于应用程序文件夹中,则CodeIgniter的重写规则可能会阻止对文件的访问。

Try adding the following line in your .htaccess file in the root of the code igniter app. 尝试将以下行添加到代码点火器应用程序根目录的.htaccess文件中。

RewriteCond $1 !^(application/css)

So the first few lines should be: 因此,前几行应为:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM