当前位置:首页 > 代码 > 正文

网页设计图片效果代码大全(网页设计与制作代码图片)[20240425更新]

admin 发布:2024-04-25 09:06 137


今天给各位分享网页设计图片效果代码大全的知识,其中也会对网页设计与制作代码图片进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

网页图片跑马灯效果代码

跑马灯大全

海波吧

!--

Begin

var

Mes=new

Array();

Mes[0]="海波吧欢迎你";

Mes[1]="感谢你关注海波吧";

Mes[2]="网页制作技巧之跑马灯大全

";

var

place=1;

var

i=0;

function

scroll()

{

window.status=Mes[i].substring(0,

place);

if

(place

=

Mes[i].length)

{

if(i2)

{

i++;

place=1;

window.setTimeout("scroll()",50);

}

else

{

i=0;

place=1;

window.setTimeout("scroll()",50);

}

}

else

{

place++;

window.setTimeout("scroll()",50);

}

}

//

End

--

滚动的文字

表示双向移动

表示运动方向向左

弹来弹去跑马灯!

表示运动方向向左

target=_blank带有超链接的跑马灯!点点看

target=_blank还有一条!点点看

参数

用法介绍

behavior=scroll,

slide,

alternate

跑马方式:循环绕行,只跑一次就停住,来回往复运动

direction=left,right

跑马方向:从左向右,从右向左

loop=100

跑马次数:循环100次,如不写默认为一直循环

width=100%,height=200

跑马范围:宽为100%,高为200像素

scrollamount=20

跑马速度:数越大越快

scrolldelay=500

跑马延时:毫秒数,利用它可实现跃进式滚动

hspace=20,vspace=20

跑马区域与其它区域间的空白大小

bgcolor=#00FFCC

跑马区域的背景颜色

网页设计 图片轮显的代码

html

head

meta http-equiv="Content-Type" content="text/html; charset=gb2312"

title无标题文档/title

SCRIPT src="js/article.js"/SCRIPT

link href="css/css.css" rel="stylesheet" type="text/css"

/head

body

table width="312" border="0" align="center" cellpadding="0" cellspacing="0" class="solidbox"

  tr

    td width="312" height="312" align="center"TABLE border=0 align="center" cellPadding=0 cellSpacing=0

      TBODY

        TR

          TDDIV id=oTransContainer 

            style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward'); WIDTH: 220px; HEIGHT: 194px"A 

            href="" 

            target=_blankIMG id=oDIV1 

            style="DISPLAY: yes;"

            height=300 src="images/01.jpg" 

            width=300 border=0/AA 

            href="" 

            target=_blankIMG id=oDIV2 

            style="DISPLAY: none;"

            height=300 src="images/02.jpg" 

            width=300 border=0/AA 

            href="" 

            target=_blankIMG id=oDIV3 

            style="DISPLAY: none;"

            height=300 src="images/03.jpg" 

            width=300 border=0/AA 

            href="" 

            target=_blankIMG id=oDIV4 

            style="DISPLAY: none;"

            height=300 src="images/04.jpg" 

            width=300 border=0/A/DIV

          /TD

        /TR

      /TBODY

    /TABLE/td

  /tr

  tr

    td height="22" align="right" valign="top"scriptvar MaxImg = 4; fnToggle();/script

      TABLE cellSpacing=1 cellPadding=0 width=110 

              border=0

      TBODY

        TR

          TD width=26A href="javascript:toggleTo(1)"IMG height=15 

                  src="images/s_1.gif" width=17 

                  border=0/A/TD

          TD width=26A href="javascript:toggleTo(2)"IMG height=15 

                  src="images/s_2.gif" width=17 

                  border=0/A/TD

          TD width=26A href="javascript:toggleTo(3)"IMG height=15 

                  src="images/s_3.gif" width=17 

                  border=0/A/TD

          TD width=27A href="javascript:toggleTo(4)"IMG height=15 

                  src="images/s_4.gif" width=17 

                  border=0/A/TD

        /TR

      /TBODY

    /TABLE/td

  /tr

/table

/body

/html

CSS的代码为:

td {font-size: 12px;}

.solidbox {

BORDER-TOP: #D7D7D7 1px solid; 

BORDER-RIGHT: #D7D7D7 1px solid; 

BORDER-BOTTOM: #D7D7D7 1px solid;

BORDER-LEFT: #D7D7D7 1px solid; 

}

网页设计常用HTML代码

网页设计常用HTML代码大全

HTML是用来描述网页的一种语言。下面我为大家分享HTML代码,希望对大家学习html代码有帮助!

忽视右键

body oncontextmenu="return false"

body style="overflow-y:hidden"

1.如何几秒后转到别的页面?

META HTTP-EQUIV="Refresh" CONTENT="时间;URL=地址"

2.点击关闭窗口

a href="javascript:top.window.close();"点击关闭窗口/a!

3.请问如何去掉主页右面的滚动条?

body scroll="no"

body style="overflow-y:hidden"

4.请问如何做到让一个网页自动关闭.

html

head

OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"

param name="Command" value="Close"

/object

/head

body onload="window.setTimeout(‘‘‘‘closes.Click()‘‘‘‘,10000)"

这个窗口会在10秒过后自动关闭,而且不会出现提示. /body

如何在不刷新页面的情况下刷新css?

style

button{ color:#000000;}

/style

button onclick=document.styleSheets[0].rules[0].style.color=‘‘‘‘red‘‘‘‘点击按钮直接修改style标签里button选择符使按钮改为红色/button

请问如何让网页自动刷新?

在head部记入META HTTP-EQUIV="Refresh" content="20"其中20为20秒后自动刷新,你可以更改为任意值。

5.如何让页面自动刷新?

方法一,用refresh

HTML 代码片段如下:

head

meta http-equiv="refresh" content="5"

/head

5表示刷新时间

[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

方法二,使用setTimeout控制

img src=/logo.gif

script

function rl(){

document.location.reload()

}

setTimeout(rl,2000)

/script

6.如何让超链接没有下划线

在源代码中的HEAD…/HEAD之间输入如下代码:

style type="text/css" !--

a { text-decoration: none}

-- /style

7.请问如何去掉IE的上下滚动条?

body style=‘‘‘‘overflow:scroll;overflow-y:hidden‘‘‘‘

/body

8.怎样才能把RealPlayer文件在网页做一个试听连接?

embed height=25 src=51js.rm type=audio/x-pn-realaudio-plugin width=50 autostart="false" controls="PlayButton"

9.如何用html实现浏览器上后退按钮的功能?

a href="java script:history.go(-1)"点击后退/a

或者

script history.back() /script

10.请问怎么在网页中改变鼠标的箭头形状?

HTML 代码片段如下:

body

a href="#" style="cursor: auto;"auto/abr

a href="#" style="cursor: crosshair "crosshair /abr

a href="#" style="cursor: default "default /abr

a href="#" style="cursor: hand "hand /abr

a href="#" style="cursor: move "move /abr

a href="#" style="cursor: e-resize "e-resize /abr

a href="#" style="cursor: ne-resize "ne-resize /abr

a href="#" style="cursor: nw-resize"nw-resize/abr

a href="#" style="cursor: n-resize"n-resize/abr

a href="#" style="cursor: se-resize"se-resize/abr

a href="#" style="cursor: sw-resize"sw-resize/abr

a href="#" style="cursor: s-resize"s-resize/abr

a href="#" style="cursor: w-resize"w-resize/abr

a href="#" style="cursor: text"text/abr

a href="#" style="cursor: wait"wait/abr

a href="#" style="cursor: help"help/abr

/body

11.怎样不使用页面的缓存?即每一次打开页面时不是调用缓存中的东西

META HTTP-EQUIV="Pragma" CONTENT="no-cache"

12.页面打开时自动弹出一个窗口的代码怎么写?

HTML 代码片段如下:

html

head

titleUntitled Document/title

meta http-equiv="Content-Type" content="text/html; charset=gb2312"

script language="B style="color:black;background-color:#A0FFFF"javascript/B"

!--

function MM_openBrWindow(theURL,winName,features) { //v2.0

window.open(theURL,winName,features);

}

//--

/script

/head

body bgcolor="#FFFFFF" text="#000000" onLoad="MM_openBrWindow(‘‘‘‘‘‘‘‘,‘‘‘‘,‘‘‘‘width=400,height=400‘‘‘‘)"

/body

/html

13.如何让我的页面出现一个会讲话的小人?Merlin

HTML 代码片段如下:

HTML

HEAD

TITLE默林/TITLE

META http-equiv=Content-Type content="text/html; charset=gb2312"

/HEAD

BODY

pOBJECT id=sims classid=CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F

/OBJECT

SCRIPT

var MerlinID;

var MerlinACS;

sims.Connected = true;

MerlinLoaded = LoadLocalAgent(MerlinID, MerlinACS);

Merlin = sims.Characters.Character(MerlinID);

Merlin.Show();

Merlin.Play("Surprised");

Merlin.Speak("大家好");

Merlin.Play("GestureLeft");

Merlin.Think("我是默林!");

Merlin.Play("Pleased");

Merlin.Think("可爱吗?");

Merlin.Play("GestureDown");

Merlin.Speak("哈哈!");

Merlin.Hide();

function LoadLocalAgent(CharID, CharACS){

LoadReq = sims.Characters.Load(CharID, CharACS);

return(true);

}

/SCRIPT

/p

p /p

p看此效果必须装有office2000!!!/p

/BODY

/HTML

14.在页面中如何加入不是满铺的背景图片,拉动页面时背景图不动

HTML 代码片段如下:

htmlhead

STYLE

body  {background-image:url(logo.gif);

background-repeat:no-repeat; background-position:center }

/STYLE

/head

body bgproperties="fixed"

/body

/html

[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

background-repeat:no-repeat; 是让背景图不占满整个页面

body bgproperties="fixed" 是拉动scroll时背景图不动

15.文本输入框什么属性能实现不可输入?

HTML 代码片段如下:

input type="text" name="textfield" disabled

或者

input type="text" name="textfield" readonly

16.如何禁止自己的页面在别人的框架里打开?

把以下代码加至你的head区

script

if (window.top!=self){

window.top.location=self.location

}

/script

17.如何实现首页全屏幕显示?

HTML 代码片段如下:

html

bodyscript language="B style="color:black;background-color:#A0FFFF"javascript/B"

var coolw=642

var coolh=400

var coolhuang=window.open("","coolhuang","width="+coolw+",height="+coolh+",

fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")

window.close()

/script/body/html

18.如何监听一个窗口被关闭了?

HTML 代码片段如下:

body onunload="alert(‘‘‘‘你关闭了这个窗口‘‘‘‘)"

19.如何禁止Ctrl+N?

HTML 代码片段如下:

body onkeydown=return(!(event.keyCode==78event.ctrlKey))

如何把页面加入用户的收藏夹?

HTML 代码片段如下:

a href="B style="color:black;background-color:#A0FFFF"javascript/B:window.external.AddFavorite(‘‘‘‘‘‘‘‘,‘‘‘‘无忧脚本‘‘‘‘)"收藏无忧脚本/a

如何在我的'页面中加入背景音乐?

IE: bgsound src="*.mid" loop=infinite

NS:embed src="*.mid" autostart=true hidden=true loop=true

*.mid你的背景音乐的midi格式文件

关于页面转换效果

meta http-equiv="page-enter" content="revealTrans(Duration=4,Transition=23)"

meta http-equiv="page-exit" content="revealTrans(Duration=4,Transition=23)"

说明:Transition=23是随机效果,另可以选0-22任一数字固定某个效果

如何设定打开页面的大小

HTML 代码片段如下:

body onload="top.resizeTo(300,200);"!--(width,height)--

怎样双击滚屏,单击停止?

HTML 代码片段如下:

html

head

title新网页1/title

/head

body

script language"B style="color:black;background-color:#A0FFFF"javascript/B"

var currentpos,timer;

function initialize()

{

timer=setInterval("scrollwindow()",10);

}

function sc(){

clearInterval(timer);

}

function scrollwindow()

{

currentpos=document.body.scrollTop;

window.scroll(0,++currentpos);

if (currentpos != document.body.scrollTop)

sc();

}

document.onmousedown=sc

document.ondblclick=initialize

/script

pa/ppa/ppa/ppaa/ppaa/ppaa/p

paa/ppaa/ppaa/ppaa/ppaa/ppaa/p

paa/ppaa/ppaa/ppaa/ppaa/ppaa/p

paa/ppaa/ppaa/ppaa/ppa/p

/body

/html

如何让body中的文字不被选中?

HTML 代码片段如下:

body onselectstart="return false" aaa/body

如何让弹出的窗口不能关闭?

在新开的窗口中加入如下代码

body onunload=open(location.href)

/body

如何让浏览器在保存页面时保存失败?

HTML 代码片段如下:

NOSCRIPT

B style="color:black;background-color:#ffff66"IFRAME/B SRC="*.html"

/B style="color:black;background-color:#ffff66"IFRAME/B

/NOSCRIPT

表单中如何用图片按钮实现 reset?

html

head

script

function aaa(){

document.forms[0].reset()

}

/script

/head

body

form

textarea rows="2" name="S1" cols="20"/textarea

input type="submit" values="提交" name="B1"

image src="logo.gif" onclick=aaa()

/form

/body/html

进入网页时弹出的信息对话框

body onLoad="window.alert(‘‘‘‘欢迎光临本站‘‘‘‘)"

关闭窗口后弹出对话框

body onUnload="window.alert(‘‘‘‘谢谢你的光临!欢迎下次再来!‘‘‘‘)"

告别提示

body onUnload= alert("再见,感谢你的访问!")

右键菜单的制作

OBJECT id=menu type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"

PARAM name="Command" value="Related Topics,menu"

PARAM name="Item1" value="动易;"

PARAM name="Item2" value="搜狐;"

PARAM name="Item3" value="新浪;"

PARAM name="Item4" value="网易;"

PARAM name="Item5" value="互动学院;"

/OBJECT script if (document.all) document.body.onmousedown=new Function("if (event.button==2) menu.Click();") /script

下拉菜单

object id=HHCtrl type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" PARAM name="Command" value="Related Topics,Menu" PARAM name="Item1" value="aspease;" PARAM name="Item2" value="byhu;" PARAM name="Item3" value="lzz;" /object a href=javascript:HHCtrl.Click() title="下拉菜单"下拉菜单/a

;

制作网页怎样做图片切换效果?最好详细代码!

1、首先输入代码:

div class="wrapper"

div id="focus"

ul

lia href="" target="_blank"img src="img/01.jpg" alt="QQ商城焦点图效果下载" //a/li

2、然后输入代码:

lia href="" target="_blank"img src="img/02.jpg" alt="QQ商城焦点图效果教程" //a/li

lia href="" target="_blank"img src="img/03.jpg" alt="jquery商城焦点图效果" //a/li

lia href="" target="_blank"img src="img/04.jpg" alt="jquery商城焦点图代码" //a/li

3、然后再输入代码:

lia href="" target="_blank"img src="img/05.jpg" alt="jquery商城焦点图源码" //a/li

/ul

/div

/div!-- wrapper end --

/body

4、然后就完成了。

网页设计 图片滚动代码

素材的准备。为了更好的表现网站的风格和特色,具备一些更富表现力和吸引力的图片是必不可少的。同理,准备了一些与网页主题密切相关的图片,用于做为实现图片滚动效果的素材。

打开Dreamweaver8,新建一网页文件,并保存为名为“index.html"文件。

切换至代码编辑界面,输入如下代码:

bodydiv id="photo-list"  ul id="scroll"  

lia href="#"img src="images/1.jpg" width="100px" height="100px" alt=""//a/li  

lia href="#"img src="images/2.jpg" width="100px" height="100px" alt=""//a/li  

lia href="#"img src="images/3.jpg" width="100px" height="100px" alt=""//a/li  

lia href="#"img src="images/4.jpg" width="100px" height="100px" alt=""//a/li  

lia href="#"img src="images/5.jpg" width="100px" height="100px" alt=""//a/li  

lia href="#"img src="images/6.jpg" width="100px" height="100px" alt=""//a/li    /ul /div/body

对应效果如图所示:

新建一CSS样式表文件,并将该文件保存到与“index.html”相同的目录下,文件名称为“MyStyle.css"。

在新建的样式表文件"MyStyle.css”文件中输入如下代码:

* { padding:0; margin:0;}       /*设置所有对像的内边距为0*/

body { text-align:center;}      /*设置页面居中对齐*/

#photo-list {

/* 6张图片的宽度(包含宽度、padding、border、图片间的留白)

计算:6*(100+2*2+1*2+9) - 9 

之所以减去9是第6张图片的右边留白 */

   width:681px;

/* 图片的宽度(包含高度、padding、border)

   计算:100+2*2+1*2  */ 

    height:106px;  

    margin:50px auto; 

 overflow:hidden;     /*溢出部份将被隐藏*/ 

    border:1px dashed #ccc;  

}  

#photo-list ul { list-style:none;}  

#photo-list li { float:left; padding-right:9px;}

#photo-list img { border:1px solid #ddd; background:#fff; padding:2px;}

对应文件内容如图所示:

在网页文件"index.html"中添加对该样式表的引用:

link rel="stylesheet" type="text/css" href="MyStyle.css"

此时网页效果如图所示:

新建一个JS文件,并将该文件另存为“MoveEffect.js"。

在”MoveEffect.js“文件中输入如下所示代码:

   var id = function(el) {          return document.getElementById(el);        },

       c = id('photo-list');

   if(c) {

       var ul = id('scroll'),

           lis = ul.getElementsByTagName('li'),

           itemCount = lis.length,

           width = lis[0].offsetWidth, //获得每个img容器的宽度

           marquee = function() {

               c.scrollLeft += 2;

               if(c.scrollLeft % width = 1){  //当 c.scrollLeft 和 width 相等时,把第一个img追加到最后面

                   ul.appendChild(ul.getElementsByTagName('li')[0]);

                   c.scrollLeft = 0;

               };

           },

           speed = 50; //数值越大越慢

       ul.style.width = width*itemCount + 'px'; //加载完后设置容器长度        

       var timer = setInterval(marquee, speed);

       c.onmouseover = function() {

           clearInterval(timer);

       };

       c.onmouseout = function() {

           timer = setInterval(marquee, speed);

       };

   };

然后在主页文件"index.html”中添加对该“MoveEffect.js”文件的引用。

script type="text/javascript" src="MoveEffect.js"/script

代码如图所示:

打开“index.html”网页文件,最终效果如果所示:

网页设计图片效果代码大全的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于网页设计与制作代码图片、网页设计图片效果代码大全的信息别忘了在本站进行查找喔。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://www.ahzz.com.cn/post/531.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载