向Drupal7添加TabSlideOut javascript
Drupal没有可用作滑动选项卡(悬停)的模块,所以我想将此模块合并到我的站点中 在尝试将上面的滑出选项卡添加到Drupal站点的过程中,我尝试将代码任意添加到html.tpl.php,选项卡部分工作(出现冲突错误)。然而,我不断收到一个与我的Superfish菜单冲突的错误。我在Drupal.org上阅读了使用template.php中的挂钩函数Drupal_add_js为主题添加javascript的内容,但是我没有看到任何东西,就我这样做时出现的选项卡而言向Drupal7添加TabSlideOut javascript,javascript,jquery,drupal,tabs,slide,Javascript,Jquery,Drupal,Tabs,Slide,Drupal没有可用作滑动选项卡(悬停)的模块,所以我想将此模块合并到我的站点中 在尝试将上面的滑出选项卡添加到Drupal站点的过程中,我尝试将代码任意添加到html.tpl.php,选项卡部分工作(出现冲突错误)。然而,我不断收到一个与我的Superfish菜单冲突的错误。我在Drupal.org上阅读了使用template.php中的挂钩函数Drupal_add_js为主题添加javascript的内容,但是我没有看到任何东西,就我这样做时出现的选项卡而言 我错过什么了吗?如果有人能帮我,
我错过什么了吗?如果有人能帮我,我将不胜感激,我已经花了好几天好几周的时间试图解决这个问题。我试过了,它是这样工作的, 将以下代码放在顶部的page.tpl.php文件中`
<script type="text/javascript">
$(function(){
$('.slide-out-div').tabSlideOut({
tabHandle: '.handle', //class of the element that will become your tab
pathToTabImage: 'images/contact_tab.gif', //path to the image for the tab //Optionally can be set using css
imageHeight: '122px', //height of tab image //Optionally can be set using css
imageWidth: '40px', //width of tab image //Optionally can be set using css
tabLocation: 'left', //side of screen where tab lives, top, right, bottom, or left
speed: 300, //speed of animation
action: 'click', //options: 'click' or 'hover', action to trigger animation
topPos: '200px', //position from the top/ use if tabLocation is left or right
leftPos: '20px', //position from left/ use if tabLocation is bottom or top
fixedPosition: false //options: true makes it stick(fixed position) on scroll
});
});
</script>`
并在page.tpl.php的底部放置以下代码
<div class="slide-out-div">
<a class="handle" href="http://link-for-non-js-users.html">Content</a>
<h3>Contact me</h3>
<p>Thanks for checking out my jQuery plugin, I hope you find this useful.
</p>
<p>This can be a form to submit feedback, or contact info</p>
</div>
联系我
感谢您查看我的jQuery插件,我希望您觉得这很有用。
这可以是提交反馈或联系信息的表单
<div class="slide-out-div">
<a class="handle" href="http://link-for-non-js-users.html">Content</a>
<h3>Contact me</h3>
<p>Thanks for checking out my jQuery plugin, I hope you find this useful.
</p>
<p>This can be a form to submit feedback, or contact info</p>
</div>