fadein

Pure JavaScript fade in function

余生长醉 提交于 2019-11-26 11:18:08
问题 Hi friends i want to fade in a div when i click on another div and for that i am using following code. Code1 works fine but i require to use the Code2 . I know there is jQuery but i require to do this in JavaScript Can you guide me that what kind of mistake i am doing or what i need change... Code1 --- Works Fine function starter() { fin(); } function fin() { for (i = 0; i <= 1; i += 0.01) { i=Math.round(i*100)/100; setTimeout(\"seto(\" + i + \")\", i * 1000); } } function seto(opa) { var ele

jQuery How do you get an image to fade in on load?

时光怂恿深爱的人放手 提交于 2019-11-26 09:34:40
问题 All I want to do is fade my logo in on the page loading. I am new today to jQuery and I can\'t managed to fadeIn on load please help. Sorry if this question has already been answered I have had a look and try to adapt other answers for different question but nothing seems to work and its starting to frustrate me. Thanks. Code: <script type=\"text/javascript\"> $(function () { .load(function () { // set the image hidden by default $(\'#logo\').hide();.fadeIn(3000); }} </script> <link rel=\

jquery fade element does not show elements styled &#39;visibility: hidden&#39;

江枫思渺然 提交于 2019-11-26 09:19:38
问题 I have a bunch of thumbnails which I am loading with a style of visibility: hidden; so that they all maintain their correct layouts. Once the page is fully loaded I have a jquery function that fades them in. This worked when their style was set to display: none; but obviously the layout screwed up then. Any suggestions? Heres the fade line: $(\'.littleme\').fadeIn(\'slow\'); 回答1: Add a few calls to the chain like this: $('.littleme').css('visibility','visible').hide().fadeIn('slow'); This