1、網頁設計里怎麼做圖片瀏覽樣式,就像在百度上瀏覽圖片,點下一張就跳轉下一張?初學者,求教啊!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "我這個只是實現了下簡單的功能,沒有樣式,也沒有用jQuery插件,如果可以建議你用jQuery插件,會更方便。裡面圖片名稱"1.png","2.png","3.png"你可以替換成你本地的圖片名稱
2、網頁設計用筆記本寫代碼中插入圖片,瀏覽器預覽顯示不出圖片
把你img標簽放到</body>前面去,還有把你第一個html標簽的/刪除掉,改成
<html>
<head>
<title>我的第一個網站</title>
</head>
<body>
<p>哇!這是我的第一個網站。</p>
<img src="314.gif" width="258" height="158"/>
</body>
</html>
3、網頁設計圖片瀏覽模塊如何設計
||<style type="text/css">
.container, .container *{margin:0; padding:0;}
.container{width:408px; height:168px; overflow:hidden;position:relative;}
.slider{position:absolute;}
.slider li{ list-style:none;display:inline;}
.slider img{ width:408px; height:168px; display:block;}
.slider2{width:2000px;}
.slider2 li{float:left;}
.num{ position:absolute; right:5px; bottom:5px;}
.num li{
float: left;
color: #FF7300;
text-align: center;
line-height: 16px;
width: 16px;
height: 16px;
font-family: Arial;
font-size: 12px;
cursor: pointer;
overflow: hidden;
margin: 3px 1px;
border: 1px solid #FF7300;
background-color: #fff;
}
.num li.on{
color: #fff;
line-height: 21px;
width: 21px;
height: 21px;
font-size: 16px;
margin: 0 1px;
border: 0;
background-color: #FF7300;
font-weight: bold;
}
</style>
<div class="container" id="idTransformView">
<ul class="slider" id="idSlider">
<li><img src="images/01.jpg"/></li>
<li><img src="images/02.jpg"/></li>
<li><img src="images/03.jpg"/></li>
</ul>
<ul class="num" id="idNum">
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
</div>
<br />
<div class="container" id="idTransformView2">
<ul class="slider slider2" id="idSlider2">
<li><img src="images/01.jpg"/></li>
<li><img src="images/02.jpg"/></li>
<li><img src="images/03.jpg"/></li>
</ul>
<ul class="num" id="idNum2">
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
</div><br />
<p>
<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 TransformView = Class.create();
TransformView.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("idTransformView", "idSlider", 168, 3, {
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();
}
})
////////////////////////test2
var objs2 = $("idNum2").getElementsByTagName("li");
var tv2 = new TransformView("idTransformView2", "idSlider2", 408, 3, {
onStart: function(){ Each(objs2, function(o, i){ o.className = tv2.Index == i ? "on" : ""; }) },//按鈕樣式
Up: false
});
tv2.Start();
Each(objs2, function(o, i){
o.onmouseover = function(){
o.className = "on";
tv2.Auto = false;
tv2.Index = i;
tv2.Start();
}
o.onmouseout = function(){
o.className = "";
tv2.Auto = true;
tv2.Start();
}
})
$("idStop").onclick = function(){ tv2.Auto = false; tv2.Stop(); }
$("idStart").onclick = function(){ tv2.Auto = true; tv2.Start(); }
$("idNext").onclick = function(){ tv2.Index++; tv2.Start(); }
$("idPre").onclick = function(){ tv2.Index--;tv2.Start(); }
$("idFast").onclick = function(){ if(--tv2.Step <= 0){tv2.Step = 1;} }
$("idSlow").onclick = function(){ if(++tv2.Step >= 10){tv2.Step = 10;} }
$("idRece").onclick = function(){ tv2.Pause-=1000; if(tv2.Pause <= 0){tv2.Pause = 0;} }
$("idAdd").onclick = function(){ tv2.Pause+=1000; if(tv2.Pause >= 5000){tv2.Pause = 5000;} }
$("idReset").onclick = function(){
tv2.Step = Math.abs(tv2.options.Step);
tv2.Time = Math.abs(tv2.options.Time);
tv2.Auto = !!tv2.options.Auto;
tv2.Pause = Math.abs(tv2.options.Pause);
}
}
</script>
4、如何製作網站中圖片瀏覽的效果
javascript部分:
var imgUrl=new Array();
var imgLink=new Array();
var imgtext=new Array();
var adNum=0;
imgUrl[1]="image/src/1.jpg";
imgtext[1]="image1";
imgLink[1]="#1";
imgUrl[2]="image/src/2.jpg";
imgtext[2]="image2";
imgLink[2]="#2";
imgUrl[3]="image/src/3.jpg";
imgtext[3]="image3";
imgLink[3]="#3";
var imgPre=new Array();
var count=0;
for (i=1;i<=3;i++)
{
if( (imgUrl[i]!="") && (imgLink[i]!="") )
{
count++;
}
else
{
break;
}
}
function playTran()
{
if (document.all)
{
imgInit.filters.revealTrans.play();
}
}
var key=0;
function nextAd()
{
if(adNum<count)
{
adNum++ ;
}
else
{
adNum=1;
}
if(key==0)
{
key=1;
}
else if(document.all)
{
imgInit.filters.revealTrans.Transition=23;
imgInit.filters.revealTrans.apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
document.images.imgInit.alt=imgtext[adNum];
theTimer=setTimeout("nextAd()", 3000);
}
function goUrl()
{
window.location=imgLink[adNum];
}
function nextImg(d)
{
imgInit.filters.revealTrans.Transition=23;
imgInit.filters.revealTrans.apply();
playTran();
if(d>0)
{
adNum++;
if(adNum>count)
{
adNum=1;
}
}
else
{
adNum--;
if(adNum<1)
{
adNum=count;
}
}
document.images.imgInit.src=imgUrl[adNum];
document.images.imgInit.alt=imgtext[adNum];
}
html部分:
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a href="javascript:goUrl()"><img src="javascript:nextAd()" name="imgInit" border=0 style="FILTER: revealTrans(ration=1,transition=23);" width="505" height="192"></a></td>
</tr>
</table>
用theTimer=setTimeout("nextAd()", 3000);實現自動播放
用clearTimeout(theTimer)可以實現停止
5、網頁設計插入圖片預覽時圖片顯示不了?圖片與網頁都放在同一個文件夾里了 ,圖片
滑鼠右鍵點擊應該顯示圖片的位置(圖片不能顯示應該有個小紅叉),查看屬性,看看圖片地址對不對
6、網站製作高手進(關於網站圖片預覽問題)
縮略圖都很小的,比起原圖不算什麼,不會增加一倍之多
7、網頁製作中設置了背景圖片,為何預覽的時候顯示不出來
具體原因有以下幾種:
第一:圖片寫在前端代碼中不顯示。
在設置圖片時,例如,圖片放置在img文件中。那麼在代碼中調用的路徑就應該為<img src="img/XXX.jpg"></img>。如果,在img文件夾前還有其他文件夾,那麼就加入絕對路徑.應該寫為/xxx/img/xxx.jpg 這樣就可以顯示出來了!
第二:圖片寫入CSS中不顯示。
在CSS中一般寫入的方式為:background:url(../img/xxx.jpg)這樣的格式去寫的!倘若無法顯示可以將寫為絕對路徑。具體寫法為:background:url(http://www.yang-q.cn/img/xxxx.jpg)或者為:background:url{../XXX/XXX/img/xxx.jpg} 如果按照以上方式還不能顯示。那麼就檢查下前端代碼中是否調用帶CSS路徑。檢查好路徑就可以顯示出來!
8、網頁設計中,怎麼製作圖片瀏覽工具?
css+js做的http://www.jsfoot.com/ http://niutuku.com/js/1/這些都是要多少有多少
9、製作網頁,插入圖片。在本地預覽就這樣。如何解決?
圖片地址不對,檢查一下圖片地址代碼。