❶ 如何實現網頁切換時的翻頁效果
要玩轉css3的3d,就必須了解幾個詞彙,便是透視(perspective)、旋轉(rotate)和移動(translate)。透視即是以現實的視角來看屏幕上的2D事物,從而展現3D的效果。旋轉則不再是2D平面上的旋轉,而是三維坐標系的旋轉,就包括X軸,Y軸,Z軸旋轉。平移同理。(兼容測試:IE8及以上、Firefox、Chrome、Opera、Safari、360等主流瀏覽器)
使用方法:1、調用CSS樣式:
<link rel="stylesheet" type="text/css" href="css/style.css" />
2、添加HTML代碼:
將<!--效果html開始-->......<!--效果html結束-->之間的html和js代碼;放在<body></body>之間。
❷ 如何用js做翻頁效果
參考代碼如下:
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<scripttype="text/javascript"language="javascript"src="http://www.codefans.net/ajaxjs/jquery-1.4.2.min.js"></script>
<scripttype="text/javascript"language="javascript">
$(function(){
$("#right").click(function(){
varroll=$("<div></div>",{css:{position:"absolute",border:"solid1px#999",left:"806px",top:"10px",height:"494px",width:"1px",background:"#fff"}}).appendTo($("#book").parent());
$(roll).animate({
left:"10px",
width:"398px"
},1000,function(){
$("#left").css({"background":"#fff"});
$(roll).fadeOut(300,function(){
$(roll).remove();
})
});
});
});
</script>
</head>
<bodystyle="padding:5px;margin:0;">
<divid="book"style="width:797px;height:494px;background:#ccc;border:solid6px#ccc;">
<divid="left"style="width:398px;height:494px;float:left;background:url(http://www.codefans.net/jscss/demoimg/201011/PLh.png)no-repeattopleft;cursor:pointer;"></div>
<divid="right"style="width:398px;height:494px;float:left;background:#fff;cursor:pointer;margin-left:1px;text-align:right;"><pstyle="margin-top:470px;font-size:12px;color:#999;">點這翻頁</p></div>
</div>
</body>
</html>
❸ 在html裡面怎麼製作多張圖片翻頁效果,下面有文字。一點擊就進去指定的頁面
兄弟 你要翻頁的效果 那就是JS 可以搞的定 而且你說一點就進去的 就是一個連接而已
<A href="#"> 把#換成你的連接的網站就可以 但翻頁效果沒這么簡單
❹ 網頁製作圖片翻頁效果
<style type="text/css">
/* 數字按鈕框樣式 */
#imgTitle {FILTER:ALPHA(opacity=70);position:relative;left:0px;text-align:left;overflow: hidden;}
#imgTitle_up {left:0px;text-align: left; height:1px; width:inherit; }
#imgTitle_down {left:0px;text-align: right; width:inherit; }
/* 圖片框樣式 */
.imgClass {border: 1px solid #000;}
/* 圖片文字框樣式 */
#txtFrom {text-align: center;vertical-align: middle;}
/* 數字按鈕樣式 */
.button {text-decoration: none;padding: 2px 7px;background: #7B7B63;margin: 0px;font: bold 9px sans-serif; border-left:#fff 1px solid;}
a.button, a.button:link, a.button:visited {font-family: sans-serif;text-decoration: none;color:#FFFFFF;background-color: #000000;}
a.button:hover {font-family: sans-serif;text-decoration: none;color:#fff;background:#fff; }
.buttonDiv {background: #000000;height: 1px;width: 21px;float: left;text-align: center; vertical-align: middle;}
/*漸變*/
.trans { width:90px; background-color:#000;filter : progid:DXImageTransform.Microsoft.Alpha(startX=0, startY=0, finishX=100, finishY=100,style=1,opacity=0,finishOpacity=40);}
</style>
<SCRIPT language=javascript type=text/javascript>
var imgWidth=160; //圖片寬
var imgHeight=220; //圖片高
var textFromHeight=2; //焦點字框高度 (單位為px)
var textStyle="f12"; //焦點字class style (不是連接class)
var textLinkStyle="p1"; //焦點字連接class style
var buttonLineOn="#f60"; //button下劃線on的顏色
var buttonLineOff="#000"; //button下劃線off的顏色
var TimeOut=7000; //每張圖切換時間 (單位毫秒);
var imgUrl=new Array();
var imgLink=new Array();
var imgtext=new Array();
var imgAlt=new Array();
var adNum=0;
//焦點字框高度樣式表 開始
document.write('<style type="text/css">');
document.write('#focuseFrom{width:'+(imgWidth+2)+';margin: 0px; padding:0px;height:'+(imgHeight+textFromHeight)+'px; overflow:hidden;}');
document.write('#txtFrom{height:'+textFromHeight+'px;line-height:'+textFromHeight+'px;width:'+imgWidth+'px;overflow:hidden;}');
document.write('#imgTitle{width:'+imgWidth+';top:-'+(textFromHeight+16)+'px;height:18px}');
document.write('</style>');
document.write('<div id="focuseFrom">');
//焦點字框高度樣式表 結束
imgUrl[1]='image/001.jpg';
imgtext[1]='<A HREF="#"></A>';
imgLink[1]='http://www.xxx.com';
imgAlt[1]='xxx';
imgUrl[2]='image/002.jpg';
imgtext[2]='<A HREF="#"></A>';
imgLink[2]='http://www.xxx.com'';
imgAlt[2]='xxx';
imgUrl[3]='image/003.jpg';
imgtext[3]='<A HREF="#"></A>';
imgLink[3]='http://www.xxx.com'';
imgAlt[3]='xxx';
function changeimg(n)
{
adNum=n;
window.clearInterval(theTimer);
adNum=adNum-1;
nextAd();
}
function goUrl(){
window.open(imgLink[adNum],'_blank');
}
//NetScape開始
if (navigator.appName == "Netscape")
{
document.write('<style type="text/css">');
document.write('.buttonDiv{height:4px;width:21px;}');
document.write('</style>');
function nextAd(){
if(adNum<(imgUrl.length-1))adNum++;
else adNum=1;
theTimer=setTimeout("nextAd()", TimeOut);
document.images.imgInit.src=imgUrl[adNum];
document.images.imgInit.alt=imgAlt[adNum];
document.getElementById('focustext').innerHTML=imgtext[adNum];
document.getElementById('link'+adNum).style.background=buttonLineOn;
document.getElementById('imgLink').href=imgLink[adNum];
for (var i=1;i<=imgUrl.length;i++)
{
if (i!=adNum){document.getElementById('link'+i).style.background=buttonLineOff;}
}
}
document.write('<a id="imgLink" href="'+imgLink[1]+'" target=_blank class="linkwhite"><img src="'+imgUrl[1]+'" name="imgInit" width='+imgWidth+' height='+imgHeight+' border=1 alt="'+imgAlt[1]+'" class="imgClass"></a><div id="txtFrom"><span id="focustext" class="'+textStyle+'">'+imgtext[1]+'</span></div>')
document.write('<div id="imgTitle">');
document.write('<div id="imgTitle_down">');
//數字按鈕代碼開始
for(var i=1;i<imgUrl.length;i++){document.write('<a href="javascript:changeimg('+i+')" class="button" style="cursor:hand" title="'+imgAlt[i]+'">'+i+'</a>');}
//數字按鈕代碼結束
document.write('</div>');
document.write('</div>');
document.write('</div>');
nextAd();
}
//NetScape結束
//IE開始
else
{
var count=0;
for (i=1;i<imgUrl.length;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="")&&(imgtext[i]!="")&&(imgAlt[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=6;
imgInit.filters.revealTrans.apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
document.images.imgInit.alt=imgAlt[adNum];
document.getElementById('link'+adNum).style.background=buttonLineOn;
for (var i=1;i<=count;i++)
{
if (i!=adNum){document.getElementById('link'+i).style.background=buttonLineOff;}
}
focustext.innerHTML=imgtext[adNum];
theTimer=setTimeout("nextAd()", TimeOut);
}
document.write('<a target=_self href="javascript:goUrl()"><img style="FILTER: revealTrans(ration=1,transition=5);" src="javascript:nextAd()" width='+imgWidth+' height='+imgHeight+' border=0 vspace="0" name=imgInit class="imgClass"></a>');
document.write('<div id="txtFrom"><span id="focustext" class="'+textStyle+'"></span></div>');
document.write('<div id="imgTitle">');
document.write(' <div id="imgTitle_down"> <a class="trans"></a>');
//數字按鈕代碼開始
for(var i=1;i<imgUrl.length;i++){document.write('<a id="link'+i+'" href="javascript:changeimg('+i+')" class="button" style="cursor:hand" title="'+imgAlt[i]+'" onFocus="this.blur()">'+i+'</a>');}
//數字按鈕代碼結束
document.write('</div>');
document.write('</div>');
document.write('</div>');
}
//IE結束
</SCRIPT>
❺ 菜雞求教 html翻頁效果
1,快速解決你問題的方法
你下的模版頁碼上a標簽
<a href="#">2</a>
設置為空了,如果你想讓它模擬跳轉的效果
可以將href='#'修改為href="xxx.html"
xxx.html以你自己命名的文件為准,文件夾下要有這個文件
然後再xxx.html裡面設置<a href="index.html">頁碼1</a>
這樣兩個頁面就可以來回跳了。
以上是靜態頁面之間的跳轉,實質上的網頁應用以更
高級的方式跳轉
2,靜態切換式的分頁原理
在頁面潛伏5個不同的DIV塊。
顯示其中之1,隱藏其他4個。
利用javascript代碼,為頁碼添加點擊事件,當頁碼改變的時候
顯示指定的塊style="display:''",影藏其他4個塊style="display:none",達到視覺上的分頁效果。
3,利用伺服器端語言或者AJAX的動態分頁
這個才算真正的分頁了。
伺服器驅動,比如PHP語言,點擊頁碼時傳遞分頁參數,伺服器刷新整個頁面。
(頁面是刷新了整個頁面,但是只改變了分頁區域的顯示,所以視覺上的差異是部分)
AJAX ,JAVASCRIPT利用非同步更新獲取其他新的分頁區域,等到獲取完畢時,只局部刷新
需要更新的區域,所以不會有視覺抖動,整個頁面也不會被刷新
PS:最近話說得有點多。。。大概開發太寂寞。。。