1.浮动置控制及切换

<div class="banner1"></div>
<div class="bot_banner">
<a href="javascript:;" class="close" title="关闭"><img src="data:images/close.gif" alt="关闭"/></a>
<div style="width:990px;margin:0 auto;">
<div class="div1"><img src="data:images/bot_bannerimg.png" /></div>
<div class="div2">
<div class="erweima">
<a href="#"><img src="data:images/qrcode_s131029.png" /></a>
<div class="erweimaimg"></div>
</div>
<a href="#" class="iphone"></a><a href="#" class="android"></a>
</div>
</div>
</div>
<style type="text/css">
*{ padding:0px; margin:0px;}
*html{background-image:url(about:blank);background-attachment:fixed;}/*解决IE6下滚动抖动的问题*/
.div1{float:left;padding:11px 0 0 15px;}
.div2{float:left;padding:11px 0 0 257px;}
.div2 a.iphone,.div2 a.android{display:inline-block;background: url(images/iphoneAndimg1.png) no-repeat;width: 175px;height: 48px;margin-right: 18px;}
.div2 .iphone{background-position: 0 0 !important;}
.div2 .iphone:hover{background-position: 0 bottom !important;}
.div2 .android{background-position: right 0 !important;}
.div2 .android:hover{background-position: right bottom !important;}
/*.div2 a:hover img{filter:alpha(opacity=90);opacity:0.9;}*/
/*.bot_banner.bg{background:none;filter:alpha(opacity=100);opacity:1;}*/
.bot_banner{ background:url(images/bot_bannerbj.png) repeat-x left bottom;position:fixed;height:71px;width:100%;left:;bottom:0px;z-index:;display:none;}
.close{float:right;margin:6px;} .bot_banner{_position:absolute;_bottom:auto;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.
offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));_margin-bottom:0px;}/**/ </style>
     $(".bot_banner").hide();
var botBanner = $('.banner1').height();
//浮动置控制及切换
$(window).on('scroll',function(){
var scrollT = $(this).scrollTop();
if(scrollT >= (botBanner - 200)){
$(".bot_banner").slideDown(800);
}else{
$(".bot_banner").hide();
}
});

1.随机效果代码部分

//banner随机数
var imgArr=["banner1","banner2"]
var radom=Math.floor(Math.random() * 2)
$(".banner1").addClass(imgArr[radom])//根据生成的随机数(0-5),从imgArr数组中得到图像名称,0表示第一
<div class="banner1"></div>
.banner1{height:438px;overflow:hidden;background:url(../images/banner1.jpg) no-repeat center top;}
.banner2{height:438px; overflow:hidden;background:url(../images/banner2.jpg) center top;}
<script type="text/ecmascript">
var imgArr = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg"]
var radom = Math.floor(Math.random() * 5)
document.getElementById("img").value = imgArr[radom];//根据生成的随机数(0-5),从imgArr数组中得到图像名称,0表示第一个
</script>
<input type="text" id="img" />
<div id="box"></div>

浮动框控制及切换、banner随机数js的更多相关文章

  1. 电力项目十三--js添加浮动框

    修改page/menu/loading.jsp页面 首先,页面中引入浮动窗样式css <!-- 浮动窗口样式css begin --> <style type="text/ ...

  2. 电力项目十一--js添加浮动框

    1.添加浮动窗口样式 <!-- 浮动窗口样式css begin --> <style type="text/css"> #msg_win{border:1p ...

  3. Js控制iFrame切换加载网址

    <html> <head> <title>Js控制 iFrame 切换加载网址</title> </head> <body> & ...

  4. Ionic Js十四:浮动框

    $ionicPopover $ionicPopover 是一个可以浮在app内容上的一个视图框. 实例 HTML 代码 <p> <button ng-click="open ...

  5. hover时显示可跟随鼠标移动的浮动框,运用函数节流与去抖进行优化

    在很多笔试面试题中总能看到js函数去抖和函数节流,看过很多关于这两者的讨论,最近终于在一个需求中使用了函数去抖(debounce)和函数节流(throttle). 需要完成的效果是,鼠标在表格的单元格 ...

  6. selenium处理Ajax浮动框方法

    package com.allin.pc;import java.util.List;import org.openqa.selenium.WebElement;import org.openqa.s ...

  7. swiper3d横向滚动多张炫酷切换banner

    最近有了个新需求,swiper3d横向滚动多张炫酷切换banner要和elementUI里边走马灯的卡片化card 类似,但是还需要h5手机触摸滚动啊啊啊啊,昨天折腾了半个早上总算完成,今天乖乖跑来m ...

  8. 非常强大的jQuery万能浮动框插件

    支持hover, click, focus以及无事件触发:支持多达12种位置的定位,出界自动调整:支持页面元素加载,Ajax加载,下拉列表,提示层效果,tip类效果等:可自定义装载容器:内置UI不错的 ...

  9. webdriver高级应用- 在ajax方式产生的浮动框中,单击选择包含某个关键字的选项

    Ajax简介: Ajax:局部刷新,原理上也是一个js,js调用服务器的远程接口刷新局部页面数据. Ajax = 异步 JavaScript 和 XML(标准通用标记语言的子集). Ajax 是一种用 ...

随机推荐

  1. Java Servlet(四):Servlet接口service工作(ServletRequest,ServletResponse对象)(jdk7+tomcat7+eclipse)

    本篇将会记录,Servlet接收客户端传递来的参数信息,并返回信息使用的对象,及这些对象的函数相关用法. 还是在java ee工程中进行操作,在WebContent目录下创建一个login.jsp文件 ...

  2. SQL复制一个表的数据到另一个表

    最近做一个项目,由于客户数据量大,为了不将数据彻底删除,于是将数据移动到历史表,原始表的数据删除.由于技术有限,想不到好的方法,于是写个存储过程 执行,为了防止执行过程中出现异常,执行不完整.用到hI ...

  3. Weblogic 所有BEA错误代码详细信息列表

    范围 子系统 类别 BEA-000001 – BEA-009999 ConsensusLeasing DatabaseLessLeasing DatabaseLessLeasing BEA-00010 ...

  4. 查看数据库磁盘使用多少G:

    查看数据库磁盘使用多少G: / / ) G from dba_segments t where t.owner = 'TPSC' group by OWNER, t.segment_name, t.s ...

  5. 初识Python第三天(一)

    一.set集合 set是一个无序且不重复的元素集合 print(dir(set)) #['__and__', '__class__', '__contains__', '__delattr__', ' ...

  6. eclipse编辑struts.xml 代码提示

    先确定xml文件 window-preferences-查询catalog 点击add 关于这个Location 先找到你下载的struts压缩包 然后找到 解压这个jar包 你会得到一些dtd文件 ...

  7. 如何在Linux中查看所有正在运行的进程

    如何在Linux中查看所有正在运行的进程 FROM:http://os.51cto.com/art/201101/244090.htm 进程是一个其中运行着一个或多个线程的地址空间和这些线程所需要的系 ...

  8. Tomcat配置文件之servlet.xml中选项介绍

    Servlet.xml 分为以下元素: server, service, Connector ( 表示客户端和service之间的连接), Engine ( 表示指定service 中的请求处理机,接 ...

  9. asp.net 之 数据库导入treeview

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  10. 20160330001 调用及触发Office Outlook 约会

    using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using Sy ...