如何在滑动期间设置滑块位置绝对并在滑动后固定,bcoz它不显示页面上的整个内容 [英] How to set slider position absolute during sliding and fixed after slidein, bcoz its not showing whole content on page

查看:95
本文介绍了如何在滑动期间设置滑块位置绝对并在滑动后固定,bcoz它不显示页面上的整个内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#slider{
    width:500px;
    top:150px;

     z-index:999999999;
    position:fixed;
    background:white;
}

#header{
    width:270px;
    height:1190px;
    position:absolute;
    right:0px;
    border:1px solid #d8d8d8;

    padding:5px 35px;
    border-radius:3px;
    box-shadow: 0 0 8px gray;
    background:white;
}


#sidebar{
    position:absolute;
    top:180px;

    left:113px;
    box-shadow: 0 0 8px gray;
}

#sidebar1{
    position:absolute;
    top:180px;
   
    z-index:999999999;
    left:113px;
    box-shadow: 0 0 8px gray;
}

推荐答案

我做过我自己。 :)

感谢我。



只需在javascript中添加css。



I did it myself. :)
Thanks to me.

just by adding css in javascript.

function open_panel()
{
    slideIt();


' #slider')。css({
position:' 绝对'

});
var a = document.getElementById( 侧栏);
a.setAttribute( id sidebar1);
a.setAttribute( onclick close_panel());
}
('#slider').css({ position: 'absolute', }); var a=document.getElementById("sidebar"); a.setAttribute("id","sidebar1"); a.setAttribute("onclick","close_panel()"); }
















function close_panel(){
slideIn();


' #slider')。css({
position:' fixed'

});
a = document.getElementById( sidebar1);
a.setAttribute( id sidebar);
a.setAttribute( onclick open_panel());
}
('#slider').css({ position: 'fixed', }); a=document.getElementById("sidebar1"); a.setAttribute("id","sidebar"); a.setAttribute("onclick","open_panel()"); }


这篇关于如何在滑动期间设置滑块位置绝对并在滑动后固定,bcoz它不显示页面上的整个内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆