Php Jquery-需要使用方面的帮助吗
这是在jquery函数中使用php脚本的正确方法吗? pathToTabImage变量Php Jquery-需要使用方面的帮助吗,php,jquery,Php,Jquery,这是在jquery函数中使用php脚本的正确方法吗? pathToTabImage变量 <script type="text/javascript"> $(function(){ $('.slide-out-div').tabSlideOut({ tabHandle: '.handle', //class of the element that will become your tab
<script type="text/javascript">
$(function(){
$('.slide-out-div').tabSlideOut({
tabHandle: '.handle', //class of the element that will become your tab
pathToTabImage: '<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/images/ack.jpg';, //path to the image for the tab //Optionally can be set using css
alert(pathToTabImage);
imageHeight: '122px', //height of tab image //Optionally can be set using css
imageWidth: '125px', //width of tab image //Optionally can be set using css
tabLocation: 'right', //side of screen where tab lives, top, right, bottom, or left
speed: 600, //speed of animation
action: 'click', //options: 'click' or 'hover', action to trigger animation
topPos: '600px', //position from the top/ use if tabLocation is left or right
leftPos: '550px', //position from left/ use if tabLocation is bottom or top
fixedPosition: false //options: true makes it stick(fixed position) on scroll
});
});
$(函数(){
$('.slide out div').tab滑出({
tabHandle:'.handle',//将成为选项卡的元素的类
pathToTabImage:'/templates//images/ack.jpg';,//选项卡的图像路径//也可以使用css设置
警报(pathToTabImage);
imageHeight:'122px',//选项卡图像的高度//也可以使用css设置
imageWidth:'125px',//选项卡图像的宽度//可以选择使用css设置
tabLocation:‘right’,//选项卡所在屏幕的一侧,顶部、右侧、底部或左侧
速度:600,//动画速度
操作:'单击',//选项:'单击'或'悬停',触发动画的操作
topPos:'600px',//从顶部开始定位/如果tabLocation为左或右,则使用
leftPos:'550px',//从左开始定位/如果tabLocation为底部或顶部,则使用
fixedPosition:false//options:true使其粘贴在滚动条上(固定位置)
});
});
删除分号
/images/ack.jpg'代码>
到
/images/ack.jpg',
此外,此警报
对您也没有任何好处,需要取消
警报(pathToTabImage)代码>这是将PHP代码以HTML、CSS或JS文档/代码段的形式插入其中的一种可用方法。然而,在语法上,几乎没有错误
PHP错误
<?php echo $this->baseurl ?>
pathToTabImage: '...';, //...
不需要的分号,以错误的方式结束语句
alert(pathToTabImage);
在另一个语句中注入独立语句您还可以通过内联连接字符串来避免跳入和跳出php:pathToTabImage:“
尽管-为什么不按照插件注释所述使用CSS来设置它呢?会容易一点。