admin管理员组文章数量:1410717
For example : .html (Click on the Contact button on the right)
I Live to have this function in my website, but I do not want to add a ton of javascript to mit. And so my question is: Is there any simple javascript to do that?
I found a tutorial that just uses CSS3 / here but it shows the panel in the Top of the site, when I want it to the left or right :D
Thanks for your reply
For example : http://www.building58./examples/tabSlideOut.html (Click on the Contact button on the right)
I Live to have this function in my website, but I do not want to add a ton of javascript to mit. And so my question is: Is there any simple javascript to do that?
I found a tutorial that just uses CSS3 http://www.1stwebdesigner./tutorials/slide-out-panel-css3/ here but it shows the panel in the Top of the site, when I want it to the left or right :D
Thanks for your reply
Share Improve this question edited May 28, 2011 at 11:29 Mutation Person 30.5k18 gold badges100 silver badges165 bronze badges asked May 28, 2011 at 11:07 nvcnvnnvcnvn 5,1838 gold badges54 silver badges78 bronze badges2 Answers
Reset to default 3i wrote a little example with a sliding panel:
<html>
<head>
<script type="text/javascript" >
</script>
<style type="text/css">
#sliding_box {
position:absolute;
width:200px;
height:200px;
background-color: red;
top:200px;
left:0px;
-moz-transition: all 1s ease-in-out;
-webkit-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
margin-left: -190px;
}
#sliding_box:hover{
margin-left: 0px;
}
</style>
</head>
<body>
<div id="sliding_box">
Sliding box
</div>
</body>
</html>
Tested it with FF4 and Chrome. You can manipulate the sliding animation with the margin-left parameter.
The thruth is, there is no simple javascript to do that. If you want the popup without any animation, you can write two css styles for 2 different classes and then swich between them with the javascript "onclick" event.
If you want a good looking popup with animation, I would still suggest you use jQuery. It's simple to include the library in your website. And there are tons of plugins for jQuery, that do exactly the thing you want. Of course you can still write your own javascript function to achieve the desired effect, but jQuery was written for that kind of stuff.
本文标签: Javascript Slide Out Panel without JQueryStack Overflow
版权声明:本文标题:Javascript Slide Out Panel without JQuery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745010377a2637517.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论