Javascript 大括号内的文件路径
我希望是一个简短的问题 我在用Joomla!2.5.8. 我刚刚发现了eCSSential,它在index.php中使用了以下代码Javascript 大括号内的文件路径,javascript,css,joomla,Javascript,Css,Joomla,我希望是一个简短的问题 我在用Joomla!2.5.8. 我刚刚发现了eCSSential,它在index.php中使用了以下代码 <script> <!-- Add eCSSential.min.js inline here --> eCSSential({ "all": "css/all.css", "(min-width: 20em)": "css/min-20em.css", "(min-w
<script>
<!-- Add eCSSential.min.js inline here -->
eCSSential({
"all": "css/all.css",
"(min-width: 20em)": "css/min-20em.css",
"(min-width: 37.5em)": "css/min-37.5em.css",
"(min-width: 50em)": "css/min-50em.css",
"(min-width: 62.5em)": "css/min-62.5em.css"
});
</script>
重要的({
“全部”:“css/all.css”,
“(最小宽度:20em)”:“css/min-20em.css”,
“(最小宽度:37.5em)”:“css/min-37.5em.css”,
“(最小宽度:50em)”:“css/min-50em.css”,
“(最小宽度:62.5em)”:“css/min-62.5em.css”
});
现在,在我的乔姆拉!我有这个
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template?>/js/eCSSential.js"></script>
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/style.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 1024px)" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/max-width-1024.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 768px)" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/max-width-758.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 524px)" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/max-width-524.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/css/lightbox.css" type="text/css" />
为什么要使用动态模板目录?只要不切换,只需编写模板名称而不是
尝试以下几点小调整:
<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/js/eCSSential.js"></script>
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/style.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 1024px)" href="<?php echo $this->baseurl; ?>/templates/nameoftemplate/css/max-width-1024.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 768px)" href="<?php echo $this->baseurl; ?>/templates/nameoftemplate/css/max-width-758.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 524px)" href="<?php echo $this->baseurl; ?>/templates/nameoftemplate/css/max-width-524.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/lightbox.css" type="text/css" />
确保模板文件夹名称正确
然后您可以通过以下方法访问它
<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/style.css" rel="stylesheet" type="text/css" />
or
<link href="<?php echo JURI::root(); ?>templates/<?php echo $this->template; ?>/css/style.css" rel="stylesheet" type="text/css" />
or
<link href="<?php echo JURI::root(); ?>templates/name of the template_folder/css/style.css" rel="stylesheet" type="text/css" />
您好,我尝试用模板名替换
,但仍然不起作用。我一定错过了什么<代码>“全部”:“css/all.css”
将变成<代码>“样式”:“/templates/nameoftemplate/css/style.css”,
但这不起作用。将其中任何一个替换为下面的都不起作用<代码>eCessential({“all”:“css/all.css”;(最小宽度:20em):“css/min-20em.css”;(最小宽度:37.5em):“css/min-37.5em.css”;(最小宽度:50em):“css/min-50em.css”;(最小宽度:62.5em):“css/min-62.5em.css”})代码>