css-transitions

css3 height transition not working

一笑奈何 提交于 2019-12-01 15:03:29
i have a problem using css3 transitions how can i make the transition smooth it appears instantly i want the div box to slowly change its height when i hover over it the html code <div id="imgs"> <img src="http://chat.ecobytes.net/img/emoticons/smile.png" alt=":)" title=":)" /> <img src="http://chat.ecobytes.net/img/emoticons/sad.png" alt=":(" title=":(" /> <img src="http://chat.ecobytes.net/img/emoticons/wink.png" alt=";)" title=";)" /> <img src="http://chat.ecobytes.net/img/emoticons/razz.png" alt=":P" title=":P" /> <img src="http://chat.ecobytes.net/img/emoticons/grin.png" alt=":D" title="

css3 transition from width auto to “n” px [duplicate]

孤街浪徒 提交于 2019-12-01 14:45:53
This question already has an answer here: How can I transition height: 0; to height: auto; using CSS? 44 answers how do I apply css transition to a div which has initial width set as auto However if I set the initial width to some number say 50px, the transition kicks in. Here is the - DEMO .container { width: 200px; background: red; height: 50px; } .child1 { background: black; display: inline-block; } .child2 { background: blue; display: inline-block; width: auto; /* this does not work */ /* width: 50px; */ /* this works */ float: right; -webkit-transition: width 2s; transition: width 2s; }

Show div after 10 secs and hide after 10 secs

梦想的初衷 提交于 2019-12-01 14:20:47
I need to show a div (e.g. #mybox) in 10secs after page load, keep it visible for another 10 secs and then hide with a nice sliding in/out effects. Thanks a lot for any hints/helps! Please use the below function: cycle(); function cycle() { $('#myid') .delay(10000) .fadeIn(300) .delay(10000) .fadeOut(300, cycle); } If we don't need a loop, then just one line of code is needed: $('#myid').delay(10000).fadeIn(300).delay(10000).fadeOut(300); Ankit Perhaps you can try something like this. setTimeout(show_div, 10000); setTimeout(hide_div, 20000); funciton show_div(){ $('#mybox').show(); } funciton

Stack CSS Transitions using multiple classes without overriding

流过昼夜 提交于 2019-12-01 14:12:38
问题 I want to use multiple classes to optionally add transitions. Instead of stacking, the previous is getting overridden. .container { transition: margin .2s; } .container.t-padding { transition: padding .2s; } The problem: Property is overridden rather than stacking http://jsfiddle.net/yz2J8/2/ (The problem) My temporary solution: Add the previous transition to the rule .container { transition: margin .2s; } .container.t-padding { transition: padding .2s, margin .2s; } http://jsfiddle.net/ZfQcp

css3 height transition not working

此生再无相见时 提交于 2019-12-01 13:53:58
问题 i have a problem using css3 transitions how can i make the transition smooth it appears instantly i want the div box to slowly change its height when i hover over it the html code <div id="imgs"> <img src="http://chat.ecobytes.net/img/emoticons/smile.png" alt=":)" title=":)" /> <img src="http://chat.ecobytes.net/img/emoticons/sad.png" alt=":(" title=":(" /> <img src="http://chat.ecobytes.net/img/emoticons/wink.png" alt=";)" title=";)" /> <img src="http://chat.ecobytes.net/img/emoticons/razz

jQuery addClass method chaining to perform CSS transitions

荒凉一梦 提交于 2019-12-01 13:02:20
What I would like to do ( broke ): <div></div> <button>go</button> $('button').click(function () { $('div').css({ 'transition': 'left 1000ms' }).addClass('left').addClass('left_more'); }); http://jsfiddle.net/0bm4wq7h/13/ Still broke : <div></div> <button>go</button> $('button').click(function () { $('div').css({ 'transition': 'left 1000ms' }).addClass('left'); console.log('test'); $('div').addClass('left_more'); }); http://jsfiddle.net/fwL3dwz2/3/ But this works : <div></div> <button>go</button> $('button').click(function () { $('div').css({ 'transition': 'left 1000ms' }).addClass('left');

css3 transition from width auto to “n” px [duplicate]

佐手、 提交于 2019-12-01 12:26:43
问题 This question already has answers here : How can I transition height: 0; to height: auto; using CSS? (47 answers) Closed 3 years ago . how do I apply css transition to a div which has initial width set as auto However if I set the initial width to some number say 50px, the transition kicks in. Here is the - DEMO .container { width: 200px; background: red; height: 50px; } .child1 { background: black; display: inline-block; } .child2 { background: blue; display: inline-block; width: auto; /*

Change background colour as page scroll without jquery?

笑着哭i 提交于 2019-12-01 11:28:50
Im trying to get a transition working so that the bg colour fades into another colour depending on position of page/i.e. triggered by divs with same class. Found some js here ( http://codepen.io/Funsella/pen/yLfAG ) which works exactly how I want on desktop, but it breaks on iPad (no matter the browser). Would anybody know how to do this transition with CSS? I found but it's triggered by a hover.. For example.. http://jsfiddle.net/L9JXG/1/ .div1 { height:200px; width:600px; position:relative; background:red; } .div1:after { position:absolute; width:100%; height:100%; content:''; background:url

Wait for css transition [duplicate]

♀尐吖头ヾ 提交于 2019-12-01 08:26:19
This question already has an answer here: Callback when CSS3 transition finishes 5 answers I am using css transitions to set the margin of one of my div. I need to know how can I wait for this effect to end so I can call other function then... Is there any way? I read some other posts on stack overflow but they all look different from my problem. What have you tried Try This SO answer The transition listner events vary in each browser, so the below function will find which listener to use and return the correct one. function whichTransitionEvent(){ var t; var el = document.createElement(

Change background colour as page scroll without jquery?

让人想犯罪 __ 提交于 2019-12-01 07:52:44
问题 Im trying to get a transition working so that the bg colour fades into another colour depending on position of page/i.e. triggered by divs with same class. Found some js here (http://codepen.io/Funsella/pen/yLfAG) which works exactly how I want on desktop, but it breaks on iPad (no matter the browser). Would anybody know how to do this transition with CSS? I found but it's triggered by a hover.. For example.. http://jsfiddle.net/L9JXG/1/ .div1 { height:200px; width:600px; position:relative;