Image effect in website

匆匆过客 提交于 2019-12-13 07:41:53

问题


Please can anyone tell me the coding in terms of Js, css for displaying image effect like one in http://dalailama.com/ ie changing of images one after another. If possible let me know about adding video link in the sidebar with the minor screen.


回答1:


This should do the trick:

HTML:

<div id="testers">
  <div class="tester">
      <img src="http://regmedia.co.uk/2008/03/18/google_adwords_machine.png" alt="" />
  </div>
</div>
<div id="morework">
  <div class="holderdiv">
    <div class="tester">
      <img src="http://www.swwebs.co.uk/images/google-pagerank.jpg" alt="" />
    </div>
  </div>
   <div class="holderdiv">
    <div class="tester">
      <img src="http://regmedia.co.uk/2008/03/18/google_adwords_machine.png" alt="" />
    </div>
  </div>   
</div>

CSS:

#morework{display:none;}

jQuery:

 $(document).ready(function(){
   function runIt(){
     $('#morework').find('.holderdiv').each(function(i, elem) {
       $("#testers").delay(5000).fadeOut(1000, function() {
         $(this).html($(elem).html());
       }).fadeIn(1000, runIt);
     });
   };
   runIt()
 });

Check it out in action here - http://jsfiddle.net/sfsPx/



来源:https://stackoverflow.com/questions/5117349/image-effect-in-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!