Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/240.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用jquery多重css方法时显示白色页面_Php_Jquery_Css_Prestashop 1.5 - Fatal编程技术网

Php 使用jquery多重css方法时显示白色页面

Php 使用jquery多重css方法时显示白色页面,php,jquery,css,prestashop-1.5,Php,Jquery,Css,Prestashop 1.5,我在prestashop 1.5主页中使用了一些jquery代码,实际上是在Header.TPL文件中 当我使用多个css方法时(一行中有多个),网站不会加载,白色页面将显示在屏幕上(比如当我们出现PHP语法错误时) 以下是代码: $(document).ready(function(){ $("#items li").hover(function(){ $(this).children('a').css({"bottom":"0px","line-heigh

我在prestashop 1.5主页中使用了一些jquery代码,实际上是在Header.TPL文件中

当我使用多个css方法时(一行中有多个),网站不会加载,白色页面将显示在屏幕上(比如当我们出现PHP语法错误时)

以下是代码:

$(document).ready(function(){
     $("#items li").hover(function(){

            $(this).children('a').css({"bottom":"0px","line-height":"120px","font-size":"25px"});

                },function(){

            $(this).children('a').css({"line-height":"25px","bottom":"-110px","font-size":"12px"});

     });
});
但此方法也可以使用:

$(document).ready(function(){
     $("#items li").hover(function(){

            $(this).children('a').css("bottom", "0px");
            $(this).children('a').css("font-size", "25px");
            $(this).children('a').css("line-height", "120px");
                },function(){
            $(this).children('a').css("bottom", "-110px");
            $(this).children('a').css("font-size", "12px");
            $(this).children('a').css("line-height", "25px");
     });
});

任何建议都将不胜感激。

因为prestashop使用Smarty作为模板,所以不能在一行使用左大括号和右大括号。但是您可以使用{redelim}表示左大括号({),使用{rdelim}表示右大括号(})

最简单的解决方案是在大括号后插入换行符。这个代码应该可以工作

$(document).ready(function(){
 $("#items li").hover(function(){

        $(this).children('a').css({
       "bottom":"0px","line-height":"120px","font-size":"25px"
        });

            },function(){

        $(this).children('a').css({
           "line-height":"25px","bottom":"-110px","font-size":"12px"
        });

 });
});