how to make slide animation?
Tags: jquery,css
Problem :
css part
body
{
background-color:black;
padding:0;
margin:0;
overflow:hidden;
}
#accordion {
display:none;
position:absolute;
left:89%;
margin-top:400px;
width:174px;
height:150px;
list-style:none;
}
#logpop
{
display:none;
position:absolute;
left:91%;
margin-top:400px;
width:174px;
height:150px;
}
<!-- login -->
<div id="logpop">
<div class="logpop_box">
<div class="form">
<input class="input_box" name="email" type="text" placeholder="aaa"/><br/>
<input class="input_box" name="pass" type="password" placeholder="*****"/>
<br/>
<button id="btn1">Login</button>
</div>
</div>
</div>
<!-- accordian menu-->
<ul id="accordion">
<li>
<a href="#" class="item popular" rel="popular"></a>
<ul id="inchat" class="list_friends">
<li class="ch0"><img src="img/49992_720384020_1896998575_q.jpg" /></li>
<li class="ch1"><img src="img/48983_615523712_8495_q.jpg" /></li>
<li class="ch2"><img src="img/41621_717814907_4472_q.jpg" /></li>
</ul>
</li>
<li>
<a href="#" class="item category" rel="category"></a>
<ul id="inchannel">
<li class="icha0"><img src="img/41403_1434825607_37944358_q.jpg">Jae Jung</li>
<li class="icha1"><img src="img/48983_615523712_8495_q.jpg"></li>
<li class="icha2"><img src="img/41621_717814907_4472_q.jpg"></li>
</ul>
</li>
</ul>
there is video running in the background and I want to make login box slice from right out of screen to left and when user clicks on button it slides to right out of screen and accordion menu slide in right out of screen to left. I wonder css for login box and accordion has right position(positioning on right screen middle) and how to implement Jquery to make sliding animation effect.
Solution :
HTML
<input id="btnStart" type="button" value="Start" />
<div id="slider">Login</div>
<div id="accordion">
<h3><a href="#">First header</a></h3>
<div>First content</div>
<h3><a href="#">Second header</a></h3>
<div>Second content</div>
</div>
CSS
body{
overflow: hidden;
}
#slider{
width: 100px;
background-color: rgb(200,200,200);
text-align: center;
position: absolute;
z-index: 100;
top: 50px;
right: -100px;
}
#accordion{
position: absolute;
z-index: 100;
top: 20px;
left: -100px;
}
input{
padding: 3px;
}
JavaScript
$("#accordion").accordion();
$("#btnStart").click(function(e) {
$("#slider").animate({
"right": "+=" + $(window).width() / 2 + "px"
}, "1000");
});
$("#slider").click(function(e) {
$("#slider").animate({
"right": "-=" + $(window).width() / 2 + "px"
}, "1000");
$("#accordion").animate({
"left": "+=" + $(window).width() / 2 + "px"
}, "1000");
});
Hope this helps you.
CSS Howto..
Supposing you are using bootstrap, just set margin-bottom: 0 for the .navbar. You might want to remove borders as well. See fiddle: https://jsfiddle.net/yyw99nky/...
I did some small tricks in css and jquery as follows., CSS Part : <style type="text/css"> .new-child { background:none !important; } .born-child { background:#d0dafd !important; } </style> jQuery Part :...
.tab:nth-child(1) { margin-left: 30%; } http://jsfiddle.net/4zrsD/1/ This won't obviously center it perfectly, but you can use media-queries to get it more centered depending on the screen width....
The simple answer is that for quirks mode and IE6, we exploit the power of CSS expressions to calculate the position of the element dynamically. As nwellcome pointed out, we...
This will do the trick, modify the width/height/marginTop and marginBottom increments/decrements as needed: (Working Example) $(document).ready(function () { $('#myImg').load(function(){ setInterval(function(){ $('#myImg').animate({'marginTop':"-=35px"},"slow"); $('#myImg').animate({'marginTop':"+=35px"},"slow");...
@all Sorry for replying very late. But I found the solution after a little bit of fiddling. I set the z-index of my header to a higher value than my...
Try something like this using replace() $('div.text').html(function(i,v){ return v.replace(/(^|\s[A-Za-z]\s|$)/g,'<b>$&</b>'); }); DEMO...
Since you look for a table like layout, stay with your inline block and give them a width (and a minor markup change, where I swapped the progress/text tags) Note,...
The browser will wrap elements into new line if they extend beyond the right edge so the width of the parent element will be 100% (max). To avoid this you...
I have modified your code abit. So basically what I did was to save the 'Correct' Answer into a variable. Then set this 'Answer' into 1 of the 9 boxes....
Forking @NilsKaspersson answer to make it work with your requirements. Transition means from X to Y, you can't expect it to work with newly created attributes. Then you have to...
I'm pretty sure this is what you're looking for: http://thejit.org/demos/ Try the SpaceTree in the middle, right. Note the custom style animations available, and the possibility to rearrange on demand...
I would recommend you to use The <table width="100%"></table> attribute for the table tag....
For elements that accept user input focus, such as button elements, the :focus pseudo-class comes close to what you want. But in this case it looks like you can expand...
Here is a generic solution. This involves having multiple headers (which can have totally different content inside) from which you selectively display one depending on the scroll position. Each header...
A better solution would be to move the border-bottom style to the <tr> (instead of <td>) and to use a custom class to specify if your <tr> needs border or...
You could just use: body { background-color: #000; } But otherwise your problem is the fixed height on your wrapper of 100%. Either remove it or change it to min-height:...
Using jQuery (lots of comments in case the syntax of jQuery is new to you): // Bind a function to the `click` event of elements matching the selector `.tabs-title` //...
Is it possible to display epub format books in web browser using pure HTML5, CSS and jQuery? Yes, it is possible. Why do you want to write an epub...
This is not possible using the style attribute. You'll have to use CSS, either in the document itself or in an external file. li:hover { background-color:#006db9; } If that's not...
Create a wrapper div around the box with overflow as hidden and give a negative margin for the #box4sides div. Check this jsFiddle : http://jsfiddle.net/7dpUA/22/ Is this what you need?...
This will style only the a elements with class close (that are a descendant of #dialog), which is what you want: unique control over your close text, not all your...
In the header, you need to float the h1 left, and the ul right, and then add display: inline to your links (to keep them on the same line). To...
Just change the value of transform: rotate(270deg) to transform: rotate(90deg) , then add transform-origin property for set a rotated element's base placement. div { width: 90px; height: 20px; background-color: yellow;...
It's nothing to do with the spans, <h4> and <h5> are already considered headers, which are always put on a new line. If you don't intend on these being headers...
What i saw in your linked site that it is not getting full width because of your label tag. following css will help you to get same width. form.wpcf7-form label...
This was pretty fun to make, check it out. https://jsfiddle.net/6brsm2zt/ JS var slider = $('#slider'); $('div').on('mouseenter','a',function(){ var box = $(this); var p = box.position(); slider.animate({ width: box.outerWidth(), left: p.left, },250);...
Just check to see if a <link> element exists with the href attribute set to your CSS file's URL: if (!$("link[href='/path/to.css']").length) $('<link href="/path/to.css" rel="stylesheet">').appendTo("head"); The plain ol' JS method is...
I think you may be just running into the minimum sizing parameters there, minWidth and minHeight - by default they are 200. Docs for minWidth and minHeight The media query...
Because you are animating opactiy, you need to set it back to 100% or 1 when hovering over the element and mank sure they @keyframes isn't running. .blink:hover { background:red;...