网页图片滚动新闻代码

合集下载

用JS实现图片轮播效果代码(一)

用JS实现图片轮播效果代码(一)

⽤JS实现图⽚轮播效果代码(⼀)⼀.实现原理(1)将所有图⽚放在⼀个⽗容器div⾥⾯,通过display属性来设置图⽚的出现与隐藏;(2)轮播图分为⼿动轮播和⾃动轮播;⼿动轮播的重点是每次点击图⽚下⽅的⼩圆圈,获得它的索引号,并让与之对应索引号的图⽚显⽰,并且此时的⼩圆圈为⾼亮显⽰;⾃动轮播:利⽤定时器setInterval(),来每隔⼀定的时间来播放⼀次图⽚。

(3)所有的基础知识:dom操作,定时器,事件运⽤。

⼆.轮播图页⾯布局:<div id="content"> <!-- 总的⽗容器 --><div class="carousel-inner"> <!-- 包含图⽚的容器 --><div class="item "><img src="./img/lunbo1.jpg" alt="第⼀张图⽚"></div><div class="item"><img src="./img/lunbo2.jpg" alt="第⼆张图⽚"></div><div class="item"><img src="./img/lunbo3.jpg" alt="第三张图⽚"></div></div><!-- 图⽚下⽅的指⽰圆圈--><ul class="carousel-indicators"><li id='pic1'>●</li><li id='pic2'>●</li><li id='pic3'>●</li></ul><!-- 图⽚左右⽅来回滚动图⽚的左右箭头--><a href="#" class="carousel-control prev"><span><</span></a><a href="#" class="carousel-control next"><span>></span></a></div>三.轮播图的css样式:#content{width: 100%;height:500px;position: relative;}.carousel-inner{position: relative;width: 100%;overflow: hidden;height:500px;}.carousel-inner>.item>img{display: block;line-height: 1;z-index: 1;}.carousel-indicators{position: absolute;bottom:10px;left:45%;z-index: 2;list-style-type: none;}.carousel-indicators li{display:inline-block;padding: 0 15px;font-size: 24px;color:#999;cursor: pointer;z-index: 2;}.active1{font-size: 28px;color:#fff;}.carousel-control{position: absolute;text-decoration:none;color: #999;font-weight: bold;opacity: .5;font-size: 40px;z-index: 3;}.carousel-control:hover{color:fff;text-decoration: none;opacity: .9;outline: none;font-size: 42px;}.prev{top: 30%;left:20px;}.next{top:30%;right: 20px;}四.轮播图的js实现代码:window.onload = function(){//轮播初始化var lunbo = document.getElementById('content');var imgs = lunbo.getElementsByTagName('img');var uls = lunbo.getElementsByTagName('ul');var lis = lunbo.getElementsByTagName('li');//初始状态下,⼀个圆圈为⾼亮模式lis[0].style.fontSize = '26px';lis[0].style.color = '#fff';//定义⼀个全局变量,⽤来进⾏⾃动轮播图⽚顺序的变化var pic_index = 1;//⾃动轮播.使⽤pic_time记录播放,可以随时使⽤clearInterval()清除掉。

[Web]通用轮播图代码示例

[Web]通用轮播图代码示例

[Web]通⽤轮播图代码⽰例⾸先是准备好的⼏张图⽚, 它们的路径是: "img/1.jpg", "img/2.jpg", "img/3.jpg", "img/4.jpg", "img/5.jpg", "img/6.jpg"代码最基本的 HTML 代码:<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Test</title><link rel="stylesheet" href="css/index.css" /> <!--引⼊样式表--><script src="js/index.js"></script> <!--引⼊JS脚本, 脚本⽤来切换图--></head><body><div id="test" class="slider"><img id="img1" src="img/1.jpg" class="current"><img id="img2" src="img/2.jpg"><img id="img3" src="img/3.jpg"></div><button onclick="setCurrent(0)">1</button> <!--在这⾥, onClick调⽤的是⽤于设置当前图⽚的⽅法, 传⼊参数为图⽚节点的索引--><button onclick="setCurrent(1)">2</button><button onclick="setCurrent(2)">3</button><button onclick="setCurrent(3)">4</button><button onclick="setCurrent(4)">5</button><button onclick="setCurrent(5)">6</button><script>setInterval(moveNext, 5000); // 每隔5s, 切换到下⼀张图⽚</script></body></html>引⼊的样式表:.slider { /* 指定轮播图容器尺⼨, 相对定位, 隐藏溢出内容 */width: 750px;height: 450px;position: relative;overflow: hidden;}.slider img { /* 指定每⼀个图⽚的尺⼨, 过渡时间, 绝对定位 */width: 100%;height: 100%;transition: all 0.5s;position: absolute;}.slider img { /* 指定所有图⽚⽔平位移-100% */transform: translateX(-100%);}.slider img.current { /* 指定带有current类的图⽚不进⾏⽔平移动 */transform: translateX(0);}.slider img.current~img{ /* 指定位于带有current类的图⽚之后的所有图⽚⽔平位移为100% */transform: translateX(100%);}.slider img.current, /* 指定带有current或last类的图⽚置顶 */.slider st{z-index: 999;}引⼊的JavaScript:function getImages() {return document.getElementById("test").querySelectorAll("img"); // 搜找该页⾯下轮播图容器中的所有img}function getCurrent() {return document.getElementById("test").querySelector("img.current"); // 搜找该页⾯下轮播图容器中当前展⽰的img}function setCurrent(index) {var imgs = getImages();var cur = getCurrent();imgs.forEach(v => v.className = ""); // 清空所有图⽚的类名cur.className = "last"; // 设置当前展⽰的图⽚的类名为 "last", 意为: "上⼀次展⽰的图⽚"imgs[index].className = "current"; // 设置要设置的图⽚的类名为 "current"}function moveNext() { // 移动展⽰图⽚到下⼀个var imgs = getImages();var curIndex;for (curIndex = 0; curIndex < imgs.length; curIndex++) {if (imgs[curIndex].className == "current") {break;}}if (curIndex + 1 < imgs.length) {setCurrent(curIndex + 1);} else {setCurrent(0);}}原理图⽚集为⼀个序列, 当前展⽰的图⽚在中间, 展⽰图⽚之前的图⽚则是在左边, ⽽之后的图⽚则是在右边.任意设置⼀个图⽚为当前展⽰的图⽚(即设置类名为current), 那么该图⽚将移动到中间. ⽽其它的图⽚, ⾃然也会移动到它两边.由于滑动时, 需要显⽰将要展⽰的图⽚, 以及将要隐藏的图⽚, 所以这两张图⽚需要置顶, 否则, 进⾏多张图⽚的切换时, 将由于默认层级关系⽽导致异常, 故设置 .current 与 .last 的 z-index 为 999.效果。

网页图片滚动新闻代码

网页图片滚动新闻代码

自动切换的图片幻灯切换效果(图片滚动新闻)可自己修改滚动图片和增加滚动图片数量,以及修改滚动图片大小等!1.效果预览:2.代码部分:(将一下代码复制粘贴到记事本中,把后缀改成.html)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="/1999/xhtml"><head><title>三个jQuery版淡入淡出自动切换的图片幻灯切换效果_</title><meta http-equiv="content-type" content="text/html;charset=gb2312"><!--把下面代码加到<head>与</head>之间--><style type="text/css">/******************************** @基于jQuery 1.4的渐入渐出切换幻灯插件* @Plugin Page:/jq-plugin-ifadeslide/* @Author Mr.Think* @Author blog /* @Creation date: 2010.08.20*******************************//*reset css*/body{font-size:0.8em;letter-spacing:1px;font-family:"MS SansSerif",Geneva,sans-serif;line-height:1.8em;}div,h2,p,ul,li{margin:0;padding:0;}h1{font-size:1em;font-weight:normal;}h1 a{background:#047;padding:2px 3px;color:#fff;text-decoration:none;}h1 a:hover{background:#a40000;color:#fff;text-decoration:underline;}h3{color:#888;font-weight:bold;font-size:1em;margin:1em auto;position:relative;}h5a{background:#000;color:#fff;text-decoration:none;font-size:12px;font-weight:normal;letter-spaci ng:3px;position:absolute;right:7px;top:7px;padding:1px 12px;}.box{width:700px;height:250px;}/*demo css*//*SAMPLE-A*/#slide{position:relative;width:200px;height:250px;overflow:hidden;border:1px solid #ccc;float:left;}#slide img{width:200px;height:250px;}#slide .ico{position:absolute;right:8px;bottom:6px;}#slide .ico li{background:#fff;float:left;display:block;width:15px;height:15px;line-height:15px;border:1px solid#cecece;font-family:Arial,Helvetica,sans-serif;text-align:center;margin:2px;padding:1px;cursor:po inter;}#slide .ico li.high{background:#047;color:#fff;font-weight:bolder;}/*SAMPLE-B*/#slide_b{position:relative;width:460px;height:250px;overflow:hidden;border:1px solid #ccc;float:right ;}#slide_b img{width:500px;height:250px;}#slide_b .ico_b{position:absolute;right:8px;bottom:6px;}#slide_b .ico_b li{background:#fff;float:left;display:block;width:15px;height:15px;line-height:15px;border:1px solid#cecece;font-family:Arial,Helvetica,sans-serif;text-align:center;margin:2px;padding:1px;cursor:po inter;}#slide_b .ico_b li.high_b{background:#a40000;color:#fff;font-weight:bolder;}/*SAMPLE-C*/#slide_c{position:relative;width:700px;height:250px;overflow:hidden;border:1px solid #ccc;margin-top:20px;}#slide_c img{width:700px;height:250px;}#slide_c .ico_c{position:absolute;right:8px;bottom:6px;}#slide_c .ico_c li{background:#fff;float:left;display:block;width:15px;height:15px;line-height:15px;border:1px solid#cecece;font-family:Arial,Helvetica,sans-serif;text-align:center;margin:2px;padding:1px;cursor:po inter;}#slide_c .ico_c li.high{background:#000;color:#fff;font-weight:bolder;}</style><script src="/images/jquery-1.4.min.js"></script><!--<script src="/images/jquery.iFadeSldie.js">//开发版文件</script>--><script src="/js_img/4-14/images/jquery.iFadeSldie.pack.js">//压缩版文件</script><script language="javascript">/******************************** @基于jQuery淡入淡出可自动切换的幻灯插件* @jQuery V esion:1.4.2* @Plugin Page:/jq-plugin-ifadeslide/* @Author Mr.Think* @Author blog /* @Creation date: 2010.08.20*******************************///调用插件并传入插件参数//此处传入的参数将覆盖jquery.iFadeSlide.js的参数,为空即使用插件文件中默认参数$(function(){//SAMPLE-A调用---未传入任何参数,调用默认参数$('div#slide').iFadeSlide();//SAMPLE-B调用---传入新的参数,将覆盖原有参数,未传入的使用默认值$('div#slide_b').iFadeSlide({field: $('div#slide_b a'),icocon:$('div.ico_b'),hoverCls: 'high_b',curIndex: 2, //索引值0起始,故此处设置为第3项高亮interval: 2000});//SAMPLE-C调用---传入新的参数,将覆盖原有参数,未传入的使用默认值$('div#slide_c').iFadeSlide({field: $('div#slide_c img'),icocon: $('div.ico_c'),outTime:100,inTime: 200});});</script></head><body>预览效果时左下角会提示错误,而且看不到效果,<font color=red>刷新一下</font>就可以看到效果了;当然,在实际使用中,不会出现这样的问题。

图片滚动代码

图片滚动代码

我把“图片轮播”代码跟大家分享一下,代码如下:<DIV style="WIDTH: 宽度px; HEIGHT: 高度px" class="slider-promo J_Slider J_TWidget" data-widget-config="{'effect':'fade','contentCls': 'lst-main', 'navCls': 'lst-trigger', 'activeTriggerCls': 'current'}" data-widget-type="Slide" data-type="fade"><ul class=lst-main><li><A style="WIDTH: 图片宽度px; HEIGHT: 图片高度px" href="商品连接地址" target=_blank><img alt="" src="图片地址"></A></li><li><A style="WIDTH: 图片宽度px; HEIGHT: 图片高度px" href="商品连接地址" target=_blank><img alt="" src="图片地址"></A></li></ul></DIV>上下切换代码:<DIV style="WIDTH: 宽度px; HEIGHT: 高度px" class="slider-promo J_Slider J_TWidget" data-widget-config="{'effect':'scrolly','contentCls': 'lst-main', 'navCls': 'lst-trigger', 'activeTriggerCls': 'current'}" data-widget-type="Slide" data-type="scroll"><ul class=lst-main><li><A style="WIDTH: 图片宽度px; HEIGHT: 图片高度px" href="商品连接地址" target=_blank><img alt="" src="图片地址"></A></li><li><A style="WIDTH: 图片宽度px; HEIGHT: 图片高度px" href="商品连接地址" target=_blank><img alt="" src="图片地址"></A></li></ul></DIV>多图滚动<!doctype html><html><head><meta charset="UTF-8"><title>auto-image</title><script src="image/jquery.js"></script><style type="text/css">body,ul,li{padding: 0; margin: 0;}ul,li{list-style: none;}body{font-size: 14px;}#demo1{position: relative;margin: 50px auto;width: 700px;border:1px solid #ccc;}#demo1 .img_list{overflow: hidden; position: relative; height: 260px;}/* 根据图片的张数来设定ul的宽度*/.img_list ul{ width: 3500px; position: absolute; height: 260px; left: 0px;}.img_list li{ float: left; width: 700px;}.img_list img{ margin: 1px; width: 698px; height: 258px;}/* 图片对应的按钮样式*/.btn_list { overflow: hidden;padding: 4px;border: 1px solid #ccc;}.btn_list li{ float: left; margin-right: 10px; color: #999; border: 1px solid #ccc; } .btn_list li:hover,.btn_list li.on{ cursor: pointer; border: 1px solid #E204A4;}.btn_list li img{ width: 163px; height: 60px; display: block;}.btn_list .last{ margin-right: 0;}/* 左右点击的按钮样式*/#demo1 .toLeft,#demo1 .toRight{display: none;position: absolute;width: 20px;height: 30px;top: 110px;background: url(image/zbbg_24.png) no-repeat 0 -150px;}/* 图片对应的说明*/.img_intro{position: absolute;bottom: 0;left: 0;width: 100%;height: 25px;}.img_intro .img_intro_bg,.img_intro .text{position: absolute;left: 0;top: 0;width: 100%;height: 100%;}.img_intro .img_intro_bg{background: #000;opacity: .3;z-index: 999;}.img_intro .text{padding: 5px 10px;z-index: 1000;color: #999;}#demo1 .toLeft{left: 20px;}#demo1 .toRight{right: 20px;background-position: -50px -150px;}</style></head><body><div id="demo1"><div class="wrap"><div class="img_list"><ul><li><a href="" target="_blank"><img src="image/gsh_banner1.jpg" alt="寻花故事"></a></li><li><a href="" target="_blank"><img src="image/gsh_banner2.jpg" alt="金瓶梅"></a></li><li><a href="" target="_blank"><img src="image/gsh_banner3.jpg" alt="视频听书"></a></li><li><a href="" target="_blank"><img src="image/gsh_banner4.jpg" alt="盗墓故事"></a></li></ul><a href="#" id="toLeft" class="link toLeft"></a><a href="#" id="toRight" class="link toRight"></a><div class="img_intro"><div class="text"><a href="#" target="_blank"></a></div><div class="img_intro_bg"></div></div></div><div class="btn_list"><ul></ul></div></div></div><script>var index = 0;var timer = 0;var ulist = $('.img_list ul');var blist = $('.btn_list ul');var list = ulist.find('li');var llength = list.length;//li的个数,用来做边缘判断var lwidth = $(list[0]).width();//每个li的长度,ul每次移动的距离var uwidth = llength * lwidth;//ul的总宽度function init(){//生成按钮(可以隐藏)addBtn(list);//显示隐藏左右点击开关$('.link').css('display', 'none');$('.link').bind('click', function(event) {var elm = $(event.target);doMove(elm.attr('id'));return false;});//初始化描述var text = ulist.find('li').eq(0).find('img').attr('alt');var link = ulist.find('li').eq(0).find('a').attr('href');$('.img_intro .text a').text(text);$('.img_intro .text a').attr('href',link);//显示和隐藏左右切换按钮$('.wrap').hover(function() {$('.link').fadeIn(1000);}, function() {$('.link').fadeOut(1000);});auto();}function auto(){//定时器timer = setInterval("doMove('toRight')",3000);$('.img_list a, .btn_list li').hover(function() {clearInterval(timer);}, function() {timer = setInterval("doMove('toRight')",3000);});}function changeBtn(i){blist.find('li').eq(i).addClass('on').siblings().removeClass('on');var text = ulist.find('li').eq(i).find('img').attr('alt');var link = ulist.find('li').eq(i).find('a').attr('href');$('.img_intro .text a').text(text);$('.img_intro .text a').attr('href',link);}function addBtn (list){for (var i = 0; i < list.length; i++) {var imgsrc = $(list[i]).find('img').attr('src');var listCon = '<li><img src="'+imgsrc+'""></li>';$(listCon).appendTo(blist);//隐藏button中的数字//list.css('text-indent', '10000px');};blist.find('li').first().addClass('on');blist.find('li').last().addClass('last');blist.find('li').click(function(event) {var _index = $(this).index();doMove(_index);});}function doMove(direction){//向右按钮if (direction =="toRight") {index++;if ( index< llength) {uwidth = lwidth *index;//ulist.css('left',-uwidth);ulist.animate({left: -uwidth}, "slow");}else{//ulist.css('left','0px');ulist.animate({left: '0px'}, "slow");index = 0;};//向左按钮}else if(direction =="toLeft"){index--;if ( index < 0) {index = llength - 1;}uwidth = lwidth *index;//ulist.css('left',-uwidth);ulist.animate({left: -uwidth}, "slow");//点击数字跳转}else{index = direction;uwidth = lwidth *index;//ulist.css('left',-uwidth);ulist.animate({left: -uwidth}, "slow");};changeBtn(index);}init();</script></body></html>。

网页里实现图片滚动代码

网页里实现图片滚动代码

网页里实现图片滚动代码看看以下代码:<table cellspacing=0 cellpadding=0 width="100%" align=center border=0><tbody><tr><td align=middle><marquee scrollamount=1 scrolldelay=100 direction=right width=120><img src="../../infoimages/images7/2009413152913734.jpg"></marquee></td><td align=middle><marquee scrollamount=1 scrolldelay=100 width=120><img src="../../infoimages/images7/2009413152913734.jpg"></marquee></td></tr></tbody></table> 此代码的功能是使你所链接的图片交叉移动!实现步骤如下:1,打开发表文章,点击“显示源代码”。

2,在以红色为标记的图片地址换成你所链接图片的地址,当然了,本地址也可以用!3,在<DIV>和</DIV>之间粘贴上面代码!(注:图片格式为JPG或者GIF)下面的代码是让图片从左向又移动!<marquee direction=right><img src=../../infoimages/images7/2009413152913734.jpg width=200 height=150><br><font color=0000ff size=5 face=华文行楷><b>移右向左从我</b></font></marquee>实现步骤如下:1,打开发表文章,点击“显示源代码”。

网站首页图片轮转代码,很好用

网站首页图片轮转代码,很好用

网站首页图片轮转代码,很好用网站首页图片轮转代码聪明的朋友可以把它用到自己的网店里面做装修,非常好用的代码如下,注释的地方需要改变即可<SCRIPT><!--以下分别是,宽,高,图片数,间隔时间-->var widths =500;var heights =410;var counts =6;var times = 4000;<!--以下12行代码中的如:/07.jpg ,改成自己需要的图片URL 即可,下面一部分的链接换成商品的地址即可-->img1=new Image ();img1.src='/07.jpg';img2=new Image ();img2.src='/06.jpg';img3=new Image ();img3.src='/05.jpg';img4=new Image ();img4.src='/04.jpg';img5=new Image ();img5.src='/03.jpg';img6=new Image ();img6.src='/02.jpg';url1=new Image ();url1.src='/';url2=new Image ();url2.src='/';url3=new Image ();url3.src='/';url4=new Image ();url4.src='/';url5=new Image ();url5.src='/';url6=new Image ();url6.src='/';//联盟商贸技术支持友情提供var nn=1;var key=0;function change_img(){if(key==0){key=1;}else if(document.all){document.getElementByIdx("pic").filters[0].Apply();document.getElementByIdx("pic").filters[0].Play(duration=2);}eval_r('document.getElementByIdx("pic").src=img'+nn+'.src' );eval_r('document.getElementByIdx("url").href=url'+nn+'.src' );for (var i=1;i<=counts;i++){document.getElementByIdx("xxjdjj"+i).className='axx';}document.getElementByIdx("xxjdjj"+nn).className='bxx';nn++;if(nn>counts){nn=1;}tt=setTimeout('change_img()',4000);}function changeimg(n){nn=n;window.clearInterval(tt);change_img();}document.write('<style>');document.write('.axx{padding:1px 7px;border-left:#cccccc 1px solid;}');document.write('a.axx:link,a.axx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#666;}');document.write('a.axx:active,a.axx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#999;}');document.write('.bxx{padding:1px 7px;border-left:#cccccc 1px solid;}');document.write('a.bxx:link,a.bxx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');document.write('a.bxx:active,a.bxx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');document.write('</style>');document.write('<divstyle="width:'+widths+'px;height:'+heights+'px;overflow:hidde n;text-overflow:clip;">');document.write('<div><a id="url" target="_blank"><img id="pic"style="border:0px;filter:progid:dximagetransform.microsoft.wip e(gradientsize=1.0,wipestyle=4, motion=forward)" width='+widths+' height='+heights+' /></a></div>');document.write('<divstyle="filter:alpha(style=1,opacity=10,finishOpacity=80);backgr ound: #888888;width:100%-2px;text-align:right;top:-12px;position:relative;margin:1px;height:12px;padding:0px;marg in:0px;border:0px;">');for(var i=1;i<counts+1;i++){document.write('<a href="javascript:changeimg('+i+');" id="xxjdjj'+i+'" class="axx" target="_self">'+i+'</a>');}document.write('</div></div>');change_img();</SCRIPT>。

网页图片轮播代码

网页图片轮播代码

网页图片轮播代码(同时适用SharePointDesigner)<script language="javascript">j=0;function show(){for(ii=1;ii<6;ii++){document.getElementById("pic"+ii).style.display="none";document.getElementById("Submit"+ii).style.backgroundColor='';}j++if(j==6){j=1;}document.getElementById("pic"+j).style.display="block";document.getElementById("Submit"+j).style.backgroundColor='blue';a=setTimeout('show()',1000);}function pic(pic){clearTimeout(a);for(var i=1;i<=5;i++){if(i==pic){document.getElementById("pic"+pic).style.display="block";document.getElementById("Submit"+pic).style.backgroundColor='blu e';j=i}else {document.getElementById("pic"+i).style.display="none";document.getElementById("Submit"+i).style.backgroundColor='';}}a=setTimeout('show()',1000);}</script><style type="text/css">input{ background-color:white; border:#FF0000border: 0px;margin: 0px;padding: 0px;height: 20px;width: 20px;font-size: 14px;}</style><body onLoad="show()"><table width="461" height="163"><tr><td width="426" rowspan="7"><img id="pic3" style="display:none"src="image/class1-2.jpg" ><img id="pic1" src="image/class1-3.jpg"><img id="pic2" style="display:none" src="image/class1-1.jpg"><img id="pic4" style="display:none" src="image/class1-4.jpg"><img id="pic5" style="display:none" src="image/class1-5.jpg"></td> <td height="15"> </td></tr><tr><td><input type="button" name="Submit1" value="1"onClick="pic('1')"></td></tr><tr><td><input type="button" name="Submit2" value="2" onClick="pic('2')" /></td></tr><tr><td><input type="button" name="Submit3" value="3" onClick="pic('3')" /></td></tr><tr><td><input type="button" name="Submit4" value="4" onClick="pic('4')" /></td></tr><tr><td><input type="button" name="Submit5" value="5" onClick="pic('5')" /></td></tr><tr><td height="15"> </td></tr></table>。

最新图片轮播代码,淘宝网图片轮播代码

最新图片轮播代码,淘宝网图片轮播代码

将以下代码保存为html格式,本代码由东阿阿胶价格网提供!<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=GB2312"></head><body style="margin: 0pt;"><style type="text/css">.container, .container *{margin:0; padding:0;}.container{width:310px; height:310px; overflow:hidden;position:relative;}.slider{position:absolute;}.slider li{ list-style:none;display:inline;}.slider img{ width:310px; height:310px; display:block;}.num{ position:absolute; right:5px; bottom:3px;}.num li{float: left;color: #FF7300;text-align: center;line-height: 12px;width: 12px;height: 12px;font-family: Arial;font-size: 10px;cursor: pointer;overflow: hidden;margin: 3px 1px;border: 1px solid #FF7300;background-color: #fff;}.num li.on{color: #fff;line-height: 16px;width: 16px;height: 16px;font-size: 16px;margin: 0 1px;border: 0;background-color: #FF7300;font-weight: bold;}</style><div style="overflow: hidden; position: relative;" class="container" id="idTransformV iew"><ul style="position: absolute; left: 0pt; top: -14px;" class="slider" id="idSlider"><li><ahref="/t_8?e=7HZ6jHSTaEdqe9B4JaKsvxvu8TZ/KbZ2VGn1yQ10ABo= &p=mm_14236404_0_0" target="_blank"><img src="/img/ejiao1.jpg" width="310px" height="310px" alt="东阿阿胶"></a></li><li><ahref="/t_8?e=7HZ6jHSTaEaFxZ%2FnIfWQd%2FynNXBejgK%2FW9x CV yzZ60B%2B&p=mm_14236404_0_0" target="_blank"><img src="/img/ejiao2.jpg" width="310px" height="310px" alt="东阿阿胶"></a></li><li><ahref="/t_8?e=7HZ6jHSTbIQwaAeNflOhsRh06jpb3CdjtNczY2XMm0i7 Ug==&amp;p=mm_14236404_0_0" target="_blank"><img src="/img/ejiao3.jpg" alt="东阿阿胶" width="310px" height="310px" border="0"></a></li><li><ahref="/t_8?e=7HZ6jHSTb0CqODOAd0Sxu1RpsHHkYILj3Q4M5OIFcd PW&p=mm_14236404_0_0" target="_blank"><img src="/img/ejiao4.jpg" width="310px" height="310px" alt="东阿阿胶"></a></li><li><ahref="/t_8?e=7HZ6jHSTZPu%2FyD4mAzXprpRLErSsvYYjItT5kFWDe YQ%3D&p=mm_14236404_0_0" target="_blank"><img src="/img/ejiao5.jpg" width="310px" height="310px" alt="东阿阿胶"></a></li><li><ahref="/t_8?e=7HZ6jHSTarng5GF5IofZtCVTILzNOzj%2FTWnhJTrwz4i N&p=mm_14236404_0_0" target="_blank"><img src="/img/ejiao6.jpg" width="310px" height="310px" alt="东阿阿胶"></a></li><li><ahref="/t_8?e=7HZ6jHSTbjJ6uayJoTlhN8e6nGJxA%2Bqr6XhtyGTgNg %3D%3D&p=mm_14236404_0_0" target="_blank"><img src="/img/ejiao7.jpg" width="310px" height="310px" alt="东阿阿胶"></a></li><li><ahref="/t_8?e=7HZ6jHSTbIWYLQAN%2F3%2B4roTHLQxXKwLVx6X QpXmhyDwP9w%3D%3D&p=mm_14236404_0_0" target="_blank"><img src="/img/ejiao8.jpg" alt="东阿阿胶" width="310px" height="310px" border="0"></a></li><li><ahref="/t_8?e=7HZ6jHSTZPux5t6gEN6sVBSY8k732zpqx5u7vy0rduch& p=mm_14236404_0_0" target="_blank"><img src="/img/ejiao9.jpg" width="310px" height="310px" alt="东阿阿胶"></a></li><li><ahref="/t_8?e=7HZ6jHSTbIblzI6tUy2Tbl2QDmVqrqRclR49OthgeBnJ6A %3D%3D&p=mm_14236404_0_0" target="_blank"><img src="/img/ejiao10.jpg" width="310px" height="310px" alt="东阿阿胶"></a></li></ul><ul class="num" id="idNum"><li class="on">1</li><li class="on">2</li><li class="on">3</li><li class="on">4</li><li class="on">5</li><li class="on">6</li><li class="on">7</li><li class="on">8</li><li class="on">9</li><li class="on">10</li></ul></div><script type="text/javascript">var $ = function (id) {return "string" == typeof id ? document.getElementById(id) : id;};var Class = {create: function() {return function() {this.initialize.apply(this, arguments);}}}Object.extend = function(destination, source) {for (var property in source) {destination[property] = source[property];}return destination;}var TransformV iew = Class.create();TransformV iew.prototype = {//容器对象,滑动对象,切换参数,切换数量initialize: function(container, slider, parameter, count, options) { if(parameter <= 0 || count <= 0) return;var oContainer = $(container), oSlider = $(slider), oThis = this; this.Index = 0;//当前索引this._timer = null;//定时器this._slider = oSlider;//滑动对象this._parameter = parameter;//切换参数this._count = count || 0;//切换数量this._target = 0;//目标参数this.SetOptions(options);this.Up = !!this.options.Up;this.Step = Math.abs(this.options.Step);this.Time = Math.abs(this.options.Time);this.Auto = !!this.options.Auto;this.Pause = Math.abs(this.options.Pause);this.onStart = this.options.onStart;this.onFinish = this.options.onFinish;oContainer.style.overflow = "hidden";oContainer.style.position = "relative";oSlider.style.position = "absolute";oSlider.style.top = oSlider.style.left = 0;},//设置默认属性SetOptions: function(options) {this.options = {//默认值Up: true,//是否向上(否则向左)Step: 5,//滑动变化率Time: 10,//滑动延时Auto: true,//是否自动转换Pause: 2000,//停顿时间(Auto为true时有效)onStart: function(){},//开始转换时执行onFinish: function(){}//完成转换时执行};Object.extend(this.options, options || {});},//开始切换设置Start: function() {if(this.Index < 0){this.Index = this._count - 1;} else if (this.Index >= this._count){ this.Index = 0; }this._target = -1 * this._parameter * this.Index;this.onStart();this.Move();},//移动Move: function() {clearTimeout(this._timer);var oThis = this, style = this.Up ? "top" : "left", iNow = parseInt(this._slider.style[style]) || 0, iStep = this.GetStep(this._target, iNow);if (iStep != 0) {this._slider.style[style] = (iNow + iStep) + "px";this._timer = setTimeout(function(){ oThis.Move(); }, this.Time);} else {this._slider.style[style] = this._target + "px";this.onFinish();if (this.Auto) { this._timer = setTimeout(function(){ oThis.Index++; oThis.Start(); }, this.Pause); }}},//获取步长GetStep: function(iTarget, iNow) {var iStep = (iTarget - iNow) / this.Step;if (iStep == 0) return 0;if (Math.abs(iStep) < 1) return (iStep > 0 ? 1 : -1);return iStep;},//停止Stop: function(iTarget, iNow) {clearTimeout(this._timer);this._slider.style[this.Up ? "top" : "left"] = this._target + "px";}};window.onload=function(){function Each(list, fun){for (var i = 0, len = list.length; i < len; i++) { fun(list[i], i); }};var objs = $("idNum").getElementsByTagName("li");var tv = new TransformView("idTransformV iew", "idSlider", 310, 10, {onStart : function(){ Each(objs, function(o, i){ o.className = tv.Index == i ? "on" : ""; }) }//按钮样式});tv.Start();Each(objs, function(o, i){o.onmouseover = function(){o.className = "on";tv.Auto = false;tv.Index = i;tv.Start();}o.onmouseout = function(){o.className = "";tv.Auto = true;tv.Start();}})}</script></body></html>。

文字代码、图片左右插入文字、滚动新闻代码、图片背景发表文章(代码大全续)

文字代码、图片左右插入文字、滚动新闻代码、图片背景发表文章(代码大全续)

顶部图片代码:<style type=text/css>body {background-image:url(背景图片地址)} .banner {background:url("顶部图片知地址") no-repeat;}</style>【12】一些细节源代码备忘图文结合图片居左居右:align=left right居中:centerborder=0 边框为零美观超级连接弹出新窗口跟在地址后边 target=blank一句代码直接插入,比你从任何地方看到的都要简单:【13】文字代码◆◆◆◆◆上下滚动的字代码<MARQUEE scrollAmount=2 scrollDelay=200 direction=up width="100%"height=210><FONT style="LINE-HEIGHT: 180%; LETTER-SPACING: 3px"color=#ffffff>所要写的字</FONT></MARQUEE>◆◆◆◆◆做比较大的字代码<FONT color=#09f7f7 size=7><STRONG><SUP><FONT color=#99ff00>ゞ要写的字ゞ</FONT></SUP></FONT>◆◆◆◆◆文字走马灯效果代码<marquee width="157" height="21">这里输入文字◆◆◆◆◆改变文字的字体和颜色代码1<b><font face=华文行楷 size=5 color=#ff0000>要修改字体和颜色的字变换字体颜色只需替换color = 后面的代码,好看的字体颜色有: #ff1493 #228b22#4169e1 #9400d3 #ff0000 #daa520◆◆◆◆◆改变文字的字体和颜色代码2<FONT face=楷体_GB2312(字体) color=#0000ff(字体颜色) size=1>輸入文字</FONT>变换字体颜色只需替换color = 后面的代码,好看的字体颜色有: #ff1493 #228b22#4169e1 #9400d3 #ff0000 #daa520◆◆◆◆◆移动文字代码<marquee width="157" height="21">你想要的文字</marquee>◆◆◆◆◆修改导航,但还是原来的格式,但是改变字体和背景代码<imgsrc="/blog/javascript:bt_1.innerText="导航文字;';bt_2.innerText='导航文字';bt_3.innerText='导航文字';bt_4.innerText='导航文字';bt_5.innerText='导航文字';bt_6.innerText='导航文字';bt_7.innerText='导航文字';bt_8.innerText='导航文字';">在加上透明效果:<imgsrc="/blog/javascript:bt_1.style.background="url()';bt_2.style.background='url()';bt_3.style.background='url()';bt_4.style.background='url()';bt_5.style.background='url()';bt_6.style.background='url()';bt_7.style.background='url()';bt_8.style.background='url()';"></img>在加上颜色效果:<imgsrc="javascript:document.getElementById('bt_1').style.color='#D9D919';document.getElementById('bt_2').style.color='#FF00FF';document.getElementById('bt_3').style.color='#FFFFFF';document.getElementById('bt_4').style.color='#33ff00';document.getElementById('bt_5').style.color='#FF7F00';document.getEl ementById('bt_6').style.color='#FF0000';document.getElementById('bt_7').style.color='#00ffff';document.getElementById('bt_8').style.color='#77aaff';"></img><font color=red></font>◆◆◆◆◆文字特效显示代码效果一:<CENTER><FONT style="COLOR: #e4dc9b; FILTER: shadow(color=black);FONT-FAMILY: 华文彩云; FONT-SIZE: 30pt; LINE-HEIGHT: 150%; WIDTH: 100%"><B>欢迎光临黑客动画吧</B></FONT></CENTER>效果二:<CENTER><FONT style="COLOR: #e4dc9b; FILTER: glow(color=black);FONT-FAMILY: 华文彩云; FONT-SIZE: 30pt; LINE-HEIGHT: 150%; WIDTH: 100%"><B>欢迎光临黑客动画吧</B></FONT></CENTER>效果三:<CENTER><FONT color=#0099ff style="FILTER: blur(add=1,direction=40,strength=10); FONT-SIZE: 30px; FONT-WEIGHT: bolder; POSITION: relative; LINE-HEIGHT: 150%; WIDTH: 450px">欢迎光临黑客动画吧</FONT></CENTER>效果四:<MARQUEE behavior=alternate direction=up height=150scrollAmount=5><MARQUEE behavior=altrnatescrollAmount=2 width=460 <IMGsrc="/bbs/UploadFile/2003-9/20039251018214901.gif"><F ONT color=red face=楷体_gb2312 size=7>欢迎光临黑客动画吧</FONT></MARQUEE></MARQUE></MARQUEE>效果五:<FONT color=#0096ff face=隶书 size=7><MARQUEE height=50 width=240>欢迎你朋友</FONT></MARQUEE><FONT color=#0000ff face=隶书 size=7><MARQUEEdirection=right height=50 width=240>友朋你迎欢</MARQUEE></FONT></FONT>◆◆◆◆◆上下左右移动文字特效代码<marquee direction=移动方向 scrollamount=移动速度数值>插入文字</marquee>[说明:direction=移动方向可选值为向上(up) 向下(down) 向左(left) 向右(right)]◆◆◆◆◆文字停停走走效果代码<marquee scrolldelay=500 scrollamount=100>插入文字</marquee>◆◆◆◆◆文字移动效果代码<marquee behavior=移动效果>插入文字</marquee>说明:behavior=scroll 一圈一圈绕着走 behavior=slide 只走一次behavior=alternate 来回走◆◆◆◆◆发光文字代码</textarea><table style="FILTER: glow(color=#6699FF,direction=2)"><font color=#ffffff size=2>要修改的文字</font></table>其中color是阴影的颜色,可以配合网页色调改变,direction是设置阴影的强度,font color是原字体的颜色◆◆◆◆◆浮雕的文字代码</textarea><table style="FILTER: dropshadow(color=#6699FF, offx=1, offy=1,positive=1);"><font color=#ffffff>要修改的文字</font></table>其中color是阴影的颜色,可以配合网页色调改变,positive是设置阴影的强度,offx和offy是设置的阴影和文字的距离,font color是原字体的颜色◆◆◆◆◆阴影的文字代码</textarea><table style="FILTER: dropshadow(color=#cccccc, offx=2, offy=2,positive=2);"><font color=#6CABE7 size=2>要修改的文字</font></table>◆◆◆◆◆文本框字体代码</textarea><TEXTAREA STYLE="font:12px;font-family:Verdana;color:#666666">输入内容注:字体(font-family)还可以选用Arial,Tahoma等等;color可自行设定<tr> 表格列 border="5"边框宽度为5像素,bordercolor="Purple"边框顔色为紫色<td> 表格栏 bgcolor="Green"表格背景顔色为绿色◆◆◆◆◆滚动字代码<marquee border="0" align="middle" scrolldelay="120">想说的字</marquee>◆◆◆◆◆从右侧进来的字和图片代码<DIV><TABLE cellSpacing=10 cellPadding=0 width="100%" border=0><TBODY><TR><TD vAlign=top width="100%"><DIV align=center><MARQUEE scrollDelay=99 width="100%" height=108 border="0"><IMGsrc="/upload/upfile/2004430154320.gif"><FONTcolor=#b990f7><FONT face=华文行楷 color=#4d4dff size=7><B>颍水相逢欢迎您</B><IMGsrc="/upload/upfile/2004430154320.gif"></FONT></FO NT></MARQUEE></DIV></TD></TR></TBODY></TABLE></DIV><DIV><TABLE cellSpacing=10 cellPadding=0 width="100%" border=0><TBODY><TR><TD vAlign=top width="100%" height=118><DIV align=center><MARQUEE scrollDelay=99 width="100%" height=108 border="0"><IMGsrc="/upload/upfile/2004430154320.gif"><FONTcolor=#b990f7><FONT face=华文行楷 color=#4d4dff size=7><B>颍水相逢欢迎您</B><IMGsrc="/upload/upfile/2004430154320.gif"></FONT></FO NT></MARQUEE></DIV></TD></TR></TBODY></TABLE></DIV>◆◆◆◆◆倒帖的文字特效代码<p align=right><FONTstyle="FONT-SIZE:50pt;filter:FlipH(color=silver);WIDTH:100%;COLOR:red;LINE-HEIGHT:150%;FONT-FAMILY:华文行楷"><B>黑客动画吧欢迎您!</B></FONT></p>◆◆◆◆◆翻转文字特效代码<FONT style="FONT-SIZE:50pt;filter:FlipV(color=silver);WIDTH:100%;COLOR:red;LINE-HEIGHT:150%;FONT-FAMILY:华文行楷"><B>黑客动画吧欢迎您!</B></FONT>◆◆◆◆◆漂动文字特效代码<table align=center border=3 bordercolor="#CD5C5C" width=450 height=350><td background=/uploadFile/2004-12/20041210163350528.jpg>< marquee behavior=alternate scrollamount=3 direction=downheight=350><marquee behavior=alternate scrollamount=3 width=500><imgsrc=1.gif><font color=red size=6><b>黑客动画吧欢迎您!</b><imgsrc=1.gif></font></marquee></table><br>◆◆◆◆◆漂的字特效代码<P align=center><MARQUEE scrollAmount=12 direction=center behavior=alternate><MARQUEE direction=up behavior=alternate width=400 height=400><P align=center><IMGsrc="/rose/0sozai/2cut/ico/50-01/s012.gif"><IM Gsrc="/bbs/UploadFile/2004-10/20041016182848353.jpg"><IMG src="/rose/0sozai/2cut/ico/50-01/s012.gif"></P ><FONT style="FONT-SIZE: 30pt; FILTER: shadow(color=000000); WIDTH: 160%; COLOR: #4d4dff; LINE-HEIGHT: 150%; FONT-FAMILY: 华文彩云">黑客动画吧欢迎您!</FONT></MARQUEE></MARQUEE></P>◆◆◆◆◆滚动字特效代码<marquee width="200" height="100" direction="right" behavior="alternate" scrollamount="6" scrolldelay="88">黑客动画吧</marquee>各参数详解:scrollAmount 它表示速度,值越大速度越快。

平面网页滚动图片代码

平面网页滚动图片代码

<nobr><div id="marqueediv8" style="width:831px;height:120px;overflow:hidden; "> <img src="images/1.jpg" width="150" height="120" border="0"/> <img src="images/2.jpg" width="150" height="120" border="0" /> <img src="images/3.jpg" width="150" height="120" border="0"/> <img src="images/4.jpg" width="150" height="120"border="0" /> <img src="images/5.jpg" width="150" height="120" border="0"/> <img src="images/6.jpg" width="150" height="120"border="0" /> <img src="images/7.jpg" width="150" height="120" border="0"/> <img src="images/8.jpg" width="150" height="120"border="0" /> <img src="images/9.jpg" width="150" height="120" border="0"/> <img src="images/10.jpg" width="150" height="120"border="0" /> <img src="images/11.jpg" width="150" height="120" border="0"/> <img src="images/12.jpg" width="150" height="120"border="0" /> <img src="images/13.jpg" width="150" height="120" border="0"/> <img src="images/14.jpg" width="150" height="120" border="0"/> </div></nobr><script>window.onload=function(){new Marquee("marqueediv8", //容器ID<br />2, //向上滚动(0向上1向下2向左3向右)<br />1, //滚动的步长<br />831, //容器可视宽度<br />120, //容器可视高度<br />30, //定时器数值越小,滚动的速度越快(1000=1秒,建议不小于20)<br />0, //间歇停顿时间(0为不停顿,1000=1秒)<br />0, //开始时的等待时间(0为不等待,1000=1秒)<br />0//间歇滚动间距(可选)<br />);};</script><script>function Marquee(){this.ID=document.getElementById(arguments[0]);this.Direction=arguments[1];this.Step=arguments[2];this.Width=arguments[3];this.Height=arguments[4];this.Timer=arguments[5];this.WaitTime=arguments[6];this.StopTime=arguments[7];if(arguments[8]){this.ScrollStep=arguments[8];}else{this.ScrollStep=this.Direction>1?this.Width: this.Height;}this.CTL=this.StartID=this.Stop=this.MouseOver=0;this.ID.style.overflowX=this.ID.style.overflowY="hidden";this.ID.noWrap=true;this.ID.style.width=this.Width;this.ID.style.height=this.Height;this.ClientScroll=this.Direction>1?this.ID.scrollWidth:this.ID.scrollHeight;this.ID.innerHTML+=this.ID.innerHTML;this.Start(this,this.Timer,this.WaitTime,this.StopTime);}Marquee.prototype.Start=function(msobj,timer,waittime,stoptime){msobj.StartID=function(){msobj.Scroll();}msobj.Continue=function(){if(msobj.MouseOver==1){setTimeout(msobj.Continue,waittime);}else{clearInterval(msobj.TimerID); msobj.CTL=msobj.Stop=0; msobj.TimerID=setInterval(msobj.StartID,timer);}}msobj.Pause=function(){msobj.Stop=1; clearInterval(msobj.TimerID); setTimeout(msobj.Continue,waittime);}msobj.Begin=function(){msobj.TimerID=setInterval(msobj.StartID,timer);msobj.ID.onmouseover=function(){msobj.MouseOver=1; clearInterval(msobj.TimerID);} msobj.ID.onmouseout=function(){msobj.MouseOver=0;if(msobj.Stop==0){clearInterval(msobj.TimerID);msobj.TimerID=setInterval(msobj.StartID,timer);}}}setTimeout(msobj.Begin,stoptime);}Marquee.prototype.Scroll=function(){switch(this.Direction){case 0:this.CTL+=this.Step;if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollTop+=this.ScrollStep+this.Step-th is.CTL; this.Pause(); return;}else{if(this.ID.scrollTop>=this.ClientScroll) this.ID.scrollTop-=this.ClientScroll; this.ID.scrollTop+=this.Step;}break;case 1:this.CTL+=this.Step;if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollTop-=this.ScrollStep+this.Step-thi s.CTL; this.Pause(); return;}else{if(this.ID.scrollTop<=0) this.ID.scrollTop+=this.ClientScroll; this.ID.scrollTop-=this.Step;}break;case 2:this.CTL+=this.Step;if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollLeft+=this.ScrollStep+this.Step-th is.CTL; this.Pause(); return;}else{if(this.ID.scrollLeft>=this.ClientScroll) this.ID.scrollLeft-=this.ClientScroll; this.ID.scrollLeft+=this.Step;}break;case 3:this.CTL+=this.Step;if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollLeft-=this.ScrollStep+this.Step-th is.CTL; this.Pause(); return;}else{if(this.ID.scrollLeft<=0) this.ID.scrollLeft+=this.ClientScroll; this.ID.scrollLeft-=this.Step;}break;}}</script>。

最简单的JavaScript图片轮播代码(两种方法)

最简单的JavaScript图片轮播代码(两种方法)

最简单的JavaScript图片轮播代码(两种方法) 通过改变每个图片的opacity属性:素材图片:代码一:最简单的轮播广告body, div, ul, li {margin: ;padding: ;}ul {list-style-type: none;}body {background: #;text-align: center;font: px/px Arial;}#box {position: relative;width: px;height: px;background: #fff;border-radius: px;border: px solid #fff;margin: px auto;}#box .list {position: relative;width: px;height: px;overflow: hidden;border: px solid #ccc;}#box .list li {position: absolute;top: ;left: ;width: px;height: px;opacity: ;transition: opacity .s linear }#box .list li.current { opacity: ;}#box .count { position: absolute; right: ;bottom: px;}#box .count li {color: #fff;float: left;width: px;height: px;cursor: pointer;margin-right: px; overflow: hidden; background: #F; opacity: .;border-radius: px;}#box .count li.current { color: #fff;opacity: .;font-weight: ; background: #f}代码二:首先第一步,下载好一个jquery库的插件,jquery.js 网上很多随处能够下载.下载的插件要放在名目下.然后在html文档中链接好第二步,布局好一个DIV,如:上一张下一张//上面的li要设定为显示,因为是第一张图片.由于方便各位网友下载能够清晰明了,我就没有用图片路径了,因为到你们电脑上就看不到了,那个地点用背景颜色.第三步,就到了写CSS的时候了.下面的CSS明白基础的人都看得明白.#scroll{width:100%; height:180px; background-color:white; position:relative;border-bottom:1px solid gray;}//那个地点是给整个大的DIV设定属性.#scroll ul{height:180px; list-style:none;}//DIV下的UL属性.#scroll ul li{width:100%; height:180px;margin:0px; padding:0px; display:none;}//DIV下的UL下的LI属性.注意:display:none;因为要将所有的li隐藏了先.当点击的时候在显示出来..subl{position:absolute; bottom:20px; left:40%; width:80px;height:20px; line-height:20px; text-align:center;font-size:16px;font-weight:bold; cursor:pointer;}//上一张按钮的属性.注意一个绝对定位..subr{position:absolute;bottom:20px; right:40%;width:80px;height:20px; line-height:20px;text-align:center;font-size:16px;font-weight:bold;cursor:pointer;}//下一张按钮的属性.注意一个绝对定位..subr:hover{ background:yellow;border-radius:10px;}.subl:hover{ background:yellow;border-radius:10px;}//以上两个hover是鼠标通过的效果.第四步,就是jquery代码了!也非常简单.先将代码看一遍,你就会用了!四步轻松搞定一个简单的轮!“[学校计划]下学期英语教研组计划”学校工作计划别详一、指导思想:在教务处的领导下,团结奋斗,协调好各备课组间的关系。

超简单版轮播图片代码

超简单版轮播图片代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>生活有诀窍</title><meta http-equiv="content-type" content="text/html; charset=UTF-8"/><script type="text/javascript">var maxWidth=600;var curTimer=null;var imageCount=4;function play(index){var targetLeft=-((index-1)*maxWidth);if(curTimer){clearTimeout(curTimer);curTimer=null;}trunLeft(targetLeft);for(var i=1;i<=imageCount;i++){document.getElementById("play"+i).style.backgroundColor="#a5a5a5";}document.getElementById("play"+index).style.backgroundColor="#e1e1e1";}function trunLeft(targetLeft){var curLeft=parseInt(getStyle(document.getElementById("imageUL"), "left"));var offset=Math.abs(Math.abs(curLeft)-Math.abs(targetLeft)); //此处可以采用Tween.js缓动来实现更多的效果if(offset>30){offset=30;}if(curLeft>targetLeft){curLeft-=offset;}else if(curLeft<targetLeft){curLeft+=offset;}else{if(curTimer){clearTimeout(curTimer);curTimer=null;}return;}document.getElementById("imageUL").style.left=curLeft+"px";curTimer=setTimeout("trunLeft("+targetLeft+")",10);}function getStyle(elem,name){var elem = (!elem) ? alert("ERROR: It is short of getStyle==>elem!") : elem;var name = (!name) ? alert("ERROR: It is short of getStyle==>name!") : name.toString();if((!elem) && (!name)){return false;}if(elem.style[name]){return elem.style[name];}else if(elem.currentStyle){return elem.currentStyle[name];}else if(document.defaultView && document.defaultView.getComputedStyle){name = name.replace(/([A-Z])/g,"-$1");name = name.toLowerCase();var s = document.defaultView.getComputedStyle(elem,"");return s && s.getPropertyValue(name);}else{return null;};}</script></head><body>本代码由<a href="" target="_blank">生活有诀窍网站()</a>QQ:2450882851提供,仅供学习使用,请务必写明来源<div style="width:600px;"><div style="position:relative;width:600px;height:200px;overflow: hidden;"><ul id="imageUL" style="position: absolute;width:2400px;margin:0px;padding:0px;left:0px;"><li style="float:left;list-style:none;width: 600px;height: 200px;"><a href="" target="_blank"><img src="image/1.jpg" style="border: none;"/></a></li><li style="float:left;list-style:none;width: 600px;height: 200px;"><a href="" target="_blank"><img src="image/2.jpg" style="border: none;"/></a></li><li style="float:left;list-style:none;width: 600px;height: 200px;"><a href="" target="_blank"><img src="image/m.jpg" style="border: none;"/></a></li><li style="float:left;list-style:none;width: 600px;height: 200px;"><a href="" target="_blank"><img src="image/3.jpg" style="border: none;"/></a></li></ul></div><div style="position:relative;top:-20px;float:right;"><ul style="margin:0px;padding:0px;left:0px;"><li id="play1" style="background-color:#e1e1e1;float:left;list-style: none;margin-left:5px;padding:1px 5px;cursor: pointer;"><span onmouseover="javascript:play(1)">1</span></li><li id="play2" style="background-color:#a5a5a5;float:left;list-style: none;margin-left:5px;padding:1px 5px;cursor: pointer;"><span onmouseover="javascript:play(2)">2</span></li><li id="play3" style="background-color:#a5a5a5;float:left;list-style: none;margin-left:5px;padding:1px 5px;cursor: pointer;"><span onmouseover="javascript:play(3)">3</span></li><li id="play4" style="background-color:#a5a5a5;float:left;list-style: none;margin-left:5px;padding:1px 5px;cursor: pointer;"><span onmouseover="javascript:play(4)">4</span></li></ul></div></div></body></html>。

动态图片新闻代码

动态图片新闻代码

代码(各个频道、向左、向右、向上滚动)一、向左滚动1、调用“图片”栏目图片的向左滚动代码(效果演示)以下是首页模板最新图片部分代码-----------------------------------<tr><td class=main_title_575><B>最新图片</B></td></tr><tr><td class=main_tdbg_575 vAlign=center align=middle height=131><!--{$GetPicPhoto(3,0,True,0,4,False,False,0,1,1,130,90,20,0,True,4)}--></td></tr>------------------------------------用以下是滚动代码代替上面红色的标签部分,注意红色部分的变化。

------------------------------------<!--滚动代码开始--><div id=demo style="OVERFLOW: hidden; WIDTH: 560px; HEIGHT: 120px"><table cellPadding=0 align=left border=0 cellspace="0"><tr><td id=demo11 vAlign=top><!--{$GetPicPhoto(3,0,True,0,12,False,False,0,1,1,130,90,20,0,True,12)}--></td><td id=demo12 vAlign=top></td></tr></table></div><SCRIPT>var speed=15demo12.innerHTML=demo11.innerHTMLfunction Marquee11(){if(demo12.offsetWidth-demo.scrollLeft<=0)demo.scrollLeft-=demo11.offsetWidthelse{demo.scrollLeft++}}var MyMar1=setInterval(Marquee11,speed)demo.onmouseover=function() {clearInterval(MyMar1)}demo.onmouseout=function() {MyMar1=setInterval(Marquee11,speed)}</SCRIPT><!--滚动代码结束-->-----------------------------------2、文章频道图片向左滚动代码(效果演示)以下是文章频道模板最新图片部分代码-----------------------------------<tr><td Class="main_title_575"><b>最新图片{$ChannelShortName}</b></td></tr><tr><td Class="main_tdbg_575">{$GetPicArticle(ChannelID,0,True,0,4,false,false,0,3,2,130,90,20,0,True,4)} </td></tr><tr><td Class="main_shadow"></td></tr>------------------------------------用以下是滚动代码代替上面红色的标签,注意红色部分的变化。

简单的动态网页源代码

简单的动态网页源代码

if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
</tr>
</table></td>
<td id=demo12></td>
</tr>
</table>
</div>
<SCRIPT>
var speed=15
demo12.innerHTML=demo11.innerHTML
function Marquee11(){
if(demo12.offsetWidth-demo.scrollLeft<=0)
星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
</script></div>
2
<SCRIPT language=JavaScript src="js/openfullwin.js"></SCRIPT>
3
<div id="jnkc" class="d12">
<table cellpadding=0 align=left border=1 cellspace="0" bordercolor="#ffffff">

JS实现头条新闻的经典轮播图效果示例

JS实现头条新闻的经典轮播图效果示例

JS实现头条新闻的经典轮播图效果⽰例本⽂实例讲述了JS实现头条新闻的经典轮播图效果。

分享给⼤家供⼤家参考,具体如下:<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport"content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>Document</title><style>*{margin:0;padding:0;list-style: none;}.box{width: 665px;height: 362px;border: solid;margin: 100px auto;position:relative ;}.left{width: 50px;height: 50px;border: solid white;border-radius: 50%;position: absolute;line-height: 50px;text-align: center;font-size: 50px;left:0px;top:180px;cursor: pointer;color: white;}.right {width: 50px;height: 50px;border: solid white;border-radius: 50%;position: absolute;line-height: 50px;text-align: center;font-size: 50px;right: 0px;top: 180px;cursor: pointer;color: white;}ul{width: 400px;height: 50px;margin:307px 188px;position: absolute;left:30px;top:24px;}li{width: 30px;height: 30px;border: solid 1px white;border-radius: 50%;float: left;cursor: pointer;line-height: 30px;text-align: center;color: white;}img{display: none;width: 665px;height: 362px;}.act{display: block;}.active{background: black;}</style></head><body><div class="box" id="box"><img src="img/1.jpg" alt="" class="act"><img src="img/2.jpg" alt=""><img src="img/3.jpg" alt=""><img src="img/4.jpg" alt=""><img src="img/5.jpg" alt=""><img src="img/6.jpg" alt=""><img src="img/7.jpg" alt=""><img src="img/8.jpg" alt=""><div class="left" id="left"> < </div><div class="right" id="right"> > </div><ul><li class="active">1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li></ul></div><script>window.onload=function () {var arrLi=document.getElementsByTagName("li");var arrImg=document.getElementsByTagName("img"); var oLeft=document.getElementById("left");var oRight=document.getElementById("right");var oBox=document.getElementById("box");var num=0;f=setInterval(abc,1000);oBox.onmouseover=function () {clearInterval(f)}oBox.onmouseout=function () {f=setInterval(abc,1000);}for(x=0;x<arrLi.length;x++) {arrLi[x].index=x;arrLi[x].onmouseover=function () {for(j=0;j<arrLi.length;j++){arrLi[j].className="";arrImg[j].className="";}this.className="active";arrImg[this.index].className="act";}}oLeft.onclick=function () {num=num-1;if(num<0){num=arrImg.length-1}for(j=0;j<arrImg.length;j++){arrImg[j].className="";arrLi[j].className="";}arrImg[num].className="act";arrLi[num].className="active";}oRight.onclick=abcfunction abc() {num=num+1;if(num>arrImg.length-1){num=0}for(j=0;j<arrImg.length;j++){arrImg[j].className="";arrLi[j].className="";}arrImg[num].className="act";arrLi[num].className="active";}}</script></body></html>本机测试运⾏效果如下:更多关于JavaScript相关内容感兴趣的读者可查看本站专题:《》、《》、《》、《》、《》、《》、《》及《》希望本⽂所述对⼤家JavaScript程序设计有所帮助。

完整的动态网页代码

完整的动态网页代码
if currentpage<1 then currentpage=1 end if
if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else
时间代码 :
1
<div id="jnkc"></div> <script>setInterval("jnkc.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000); </script></div>
二、天气预报的代码:
<div align="center"><iframe src=" /weather.htm" width="160" heightபைடு நூலகம்"60"
frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe> </div>
currentpage= totalPut \ MaxPerPage + 1 end if end if
if currentPage=1 then showContent showpage totalput,MaxPerPage,"newsml.asp" else if (currentPage-1)*MaxPerPage<totalPut then rs.move (currentPage-1)*MaxPerPage dim bookmark bookmark=rs.bookmark showContent showpage totalput,MaxPerPage,"newsml.asp" else currentPage=1 showContent showpage totalput,MaxPerPage,"newsml.asp" end if end if end if
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

自动切换的图片幻灯切换效果(图片滚动新闻)可自己修改滚动图片和增加滚动图片数量,以及修改滚动图片大小等!1.效果预览:2.代码部分:(将一下代码复制粘贴到记事本中,把后缀改成.html)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="/1999/xhtml"><head><title>三个jQuery版淡入淡出自动切换的图片幻灯切换效果_</title><meta http-equiv="content-type" content="text/html;charset=gb2312"><!--把下面代码加到<head>与</head>之间--><style type="text/css">/******************************** @基于jQuery 1.4的渐入渐出切换幻灯插件* @Plugin Page:/jq-plugin-ifadeslide/* @Author Mr.Think* @Author blog /* @Creation date: 2010.08.20*******************************//*reset css*/body{font-size:0.8em;letter-spacing:1px;font-family:"MS SansSerif",Geneva,sans-serif;line-height:1.8em;}div,h2,p,ul,li{margin:0;padding:0;}h1{font-size:1em;font-weight:normal;}h1 a{background:#047;padding:2px 3px;color:#fff;text-decoration:none;}h1 a:hover{background:#a40000;color:#fff;text-decoration:underline;}h3{color:#888;font-weight:bold;font-size:1em;margin:1em auto;position:relative;}h5a{background:#000;color:#fff;text-decoration:none;font-size:12px;font-weight:normal;letter-spaci ng:3px;position:absolute;right:7px;top:7px;padding:1px 12px;}.box{width:700px;height:250px;}/*demo css*//*SAMPLE-A*/#slide{position:relative;width:200px;height:250px;overflow:hidden;border:1px solid #ccc;float:left;}#slide img{width:200px;height:250px;}#slide .ico{position:absolute;right:8px;bottom:6px;}#slide .ico li{background:#fff;float:left;display:block;width:15px;height:15px;line-height:15px;border:1px solid#cecece;font-family:Arial,Helvetica,sans-serif;text-align:center;margin:2px;padding:1px;cursor:po inter;}#slide .ico li.high{background:#047;color:#fff;font-weight:bolder;}/*SAMPLE-B*/#slide_b{position:relative;width:460px;height:250px;overflow:hidden;border:1px solid #ccc;float:right ;}#slide_b img{width:500px;height:250px;}#slide_b .ico_b{position:absolute;right:8px;bottom:6px;}#slide_b .ico_b li{background:#fff;float:left;display:block;width:15px;height:15px;line-height:15px;border:1px solid#cecece;font-family:Arial,Helvetica,sans-serif;text-align:center;margin:2px;padding:1px;cursor:po inter;}#slide_b .ico_b li.high_b{background:#a40000;color:#fff;font-weight:bolder;}/*SAMPLE-C*/#slide_c{position:relative;width:700px;height:250px;overflow:hidden;border:1px solid #ccc;margin-top:20px;}#slide_c img{width:700px;height:250px;}#slide_c .ico_c{position:absolute;right:8px;bottom:6px;}#slide_c .ico_c li{background:#fff;float:left;display:block;width:15px;height:15px;line-height:15px;border:1px solid#cecece;font-family:Arial,Helvetica,sans-serif;text-align:center;margin:2px;padding:1px;cursor:po inter;}#slide_c .ico_c li.high{background:#000;color:#fff;font-weight:bolder;}</style><script src="/images/jquery-1.4.min.js"></script><!--<script src="/images/jquery.iFadeSldie.js">//开发版文件</script>--><script src="/js_img/4-14/images/jquery.iFadeSldie.pack.js">//压缩版文件</script><script language="javascript">/******************************** @基于jQuery淡入淡出可自动切换的幻灯插件* @jQuery V esion:1.4.2* @Plugin Page:/jq-plugin-ifadeslide/* @Author Mr.Think* @Author blog /* @Creation date: 2010.08.20*******************************///调用插件并传入插件参数//此处传入的参数将覆盖jquery.iFadeSlide.js的参数,为空即使用插件文件中默认参数$(function(){//SAMPLE-A调用---未传入任何参数,调用默认参数$('div#slide').iFadeSlide();//SAMPLE-B调用---传入新的参数,将覆盖原有参数,未传入的使用默认值$('div#slide_b').iFadeSlide({field: $('div#slide_b a'),icocon:$('div.ico_b'),hoverCls: 'high_b',curIndex: 2, //索引值0起始,故此处设置为第3项高亮interval: 2000});//SAMPLE-C调用---传入新的参数,将覆盖原有参数,未传入的使用默认值$('div#slide_c').iFadeSlide({field: $('div#slide_c img'),icocon: $('div.ico_c'),outTime:100,inTime: 200});});</script></head><body>预览效果时左下角会提示错误,而且看不到效果,<font color=red>刷新一下</font>就可以看到效果了;当然,在实际使用中,不会出现这样的问题。

<br><!--把下面代码加到<body>与</body>之间--><div class="box"><!--SAMPLE-A--><div id="slide"><img src="/js_img/8-24/images/01.jpg" title="demo" alt="demo"><img src="/js_img/8-24/images/02.jpg" title="demo" alt="demo"><img src="/js_img/8-24/images/04.jpg" title="demo" alt="demo"><div class="ico"></div></div><!--SAMPLE-A end--><!--SAMPLE-B--><div id="slide_b"><a href=""><img src="/js_img/8-24/images/01.jpg" title="demo" alt="demo"></a><a href=""><img src="/js_img/8-24/images/02.jpg" title="demo" alt="demo"></a><a href=""><img src="/js_img/8-24/images/03.jpg" title="demo" alt="demo"></a><a href=""><img src="/js_img/8-24/images/04.jpg" title="demo" alt="demo"></a><div class="ico_b"></div></div><!--SAMPLE-B end--></div><!--SAMPLE-C--><div id="slide_c"><img src="/js_img/8-24/images/01.jpg" title="demo" alt="demo"><img src="/js_img/8-24/images/02.jpg" title="demo" alt="demo"><img src="/js_img/8-24/images/03.jpg" title="demo" alt="demo"><img src="/js_img/8-24/images/04.jpg" title="demo" alt="demo"><img src="/js_img/8-24/images/05.jpg" title="demo" alt="demo"><div class="ico_c"></div></div><!--SAMPLE-C end--></body></html>。

相关文档
最新文档