右侧悬浮层代码,鼠标经过二维码,电话号码
XML/HTML Code
- <div id="leftsead">
- <ul>
- <li>
- <a id="top_btn">
- <img src="images/ll06.png" width="47" height="49" class="hides"/>
- <img src="images/l06.png" width="47" height="49" class="shows" />
- </a>
- </li>
- <li>
- <a href="">
- <img src="images/ll03.png" width="47" height="49" class="hides"/>
- <img src="images/l03.png" width="47" height="49" class="shows" />
- </a>
- </li>
- <li>
- <a href="">
- <img src="images/ll02.png" width="166" height="49" class="hides"/>
- <img src="images/l04.png" width="47" height="49" class="shows" />
- </a>
- </li>
- <li>
- <a class="youhui">
- <img src="images/l02.png" width="47" height="49" class="shows" />
- <img src="http://www.freejs.net/uploadpic/20181007053347.jpg" width="196" height="205" class="hides" usemap="#taklhtml"/>
- </a>
- </li>
- </ul>
- </div><!--leftsead end-->
JavaScript Code
- <script type="text/javascript">
- $(document).ready(function(){
- $("#leftsead a").hover(function(){
- if($(this).prop("className")=="youhui"){
- $(this).children("img.hides").show();
- }else{
- $(this).children("img.hides").show();
- $(this).children("img.shows").hide();
- $(this).children("img.hides").animate({marginRight:'0px'},'slow');
- }
- },function(){
- if($(this).prop("className")=="youhui"){
- $(this).children("img.hides").hide('slow');
- }else{
- $(this).children("img.hides").animate({marginRight:'-143px'},'slow',function(){$(this).hide();$(this).next("img.shows").show();});
- }
- });
- $("#top_btn").click(function(){if(scroll=="off") return;$("html,body").animate({scrollTop: 0}, 600);});
- });
- </script>
原文地址:http://www.freejs.net/article_jquerywenzi_703.html