我想在点击magento按钮后显示div。
代码是
<div id="clickme" style="background-color: #333333; color: #FFFFFF; padding: 10px; width: 200px; cursor:pointer;">Click here to toggle me in and out</div>
<div id="me" style="display: none !important;"> <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footerbanner')->toHTML();?></div>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($) { $('#clickme').click(function() { $('#me').animate({
height: 'toggle'
}, 1000
);
});
});
它的工作。但是通过这个代码页脚被移动了但我希望Body内容转移到top而不是footer。请帮帮我......
答案 0 :(得分:1)
尝试使用您的页脚div
<div id="footer" style='position:fixed;bottom: 0px;height: 40px;float: left;'>footer footer footer footer </div>
因此,页脚将始终显示在页面底部...
编辑: 根据您的要求,试试这个,
<强> HTML 强>
<div id="Content_div" style="height: 400px;">
</div>
<div id="ja-botsl">
<div class="main col4-set clearfix">
<div style="height: 200px;" class="main-inner clearfix">
</div>
<span class='imgExpandSpan' id="ja-expand-trig"> </span>
</div>
</div>
<div id="footer_div" style="height: 100px;">
</div>
<强> CSS 强>
<style type="text/css">
.imgExpandSpan
{
background: url("https://bangalore/Ogo/Content/Images/arrow-green.png") no-repeat scroll center center #111111;
cursor: pointer;
height: 30px;
left: 50%;
position: absolute;
top: -29px;
width: 60px;
}
.imgExpandSpan.expand
{
background-image: url("https://bangalore/Ogo/Content/Images/arrow-red.png");
}
#ja-botsl
{
background: none repeat scroll 0 0 #111111;
border-top: 1px solid #CCCCCC;
color: #666666;
position: relative;
z-index: 2;
}
</style>
<强> JQuery的强>
你应该使用下面给出的插件
以下是Live Demo
注意:ja.script.js
的脚本包含我们所有的点击事件ID&amp;扩展内部div id。所以我们可以改变id's。,,