کد اجرای پانوراما  وبلاگ

کد اجرای پانوراما  وبلاگ این کد با جاوا ساخته شده و در هد سایت و … استفاده میشود. با این کد عکسهای پانور ما را در سایت به صورت زیبا نمایش دهید.

ادرس عکس مورد نظر خودتونودرکد جایگزین کنید وکدرادر قالب سایت و یا صفحات جداگانه قرار دهیدو اجرا کنید

توجه نمایید برای ویرایش و شخصی سازی میتوانید از ابتدای کد ادرس تصویر و سرعت حرکت و …. را تغییر دهید وبرای اینکار  ابزار پیش نمایش کدبازان استفاده نمایید.

برای درک بهتر دمو کد را مشاهده نمایید.

کد اجرای پانوراما در سایت

دمو کد

<script language="JavaScript">
impad='http://up.suchi.ir/view/1690002/653007028.jpg'; //the path to your panorama-pic
imwid=900; //the width of your pic
imhei=400; //the height of your pic
poslef=25; //the left position of the panorama on your page
postop=25; //the top position of the panorama on your page
panwid=400; //the width of the shown area
panhei=200; //the height of the shown area
//if it differs from the image-height, the image gets scaled in length and height
speed=40; //timeout between moves; set it lower to increase speed
move=5; // movement at one step in pixel


tim=0;noscroll=true;
imw=imwid*panhei/imhei;imh=panhei;imstart=panwid/2-imw*1.5;
jumpa=panwid/2-imw*2.5;jumpwida=imw-move;
jumpb=panwid/2-imw/2;jumpwidb=imw+move;
conwid=15;contop=postop+(imh*1)+(10*1);
conlefa=poslef+(panwid/2)-conwid;conlefb=poslef+(panwid/2);

function sr(){
	if(!noscroll){
	now=parseFloat(document.getElementById("pano").style.left);
  if (now<=jumpa){now+=jumpwida;} else{now-=move;}
  document.getElementById("pano").style.left=now;
	tim=setTimeout("sr()",speed);}}

function sl(){
	if(!noscroll){
	now=parseFloat(document.getElementById("pano").style.left);
  if (now>=jumpb){now-=jumpwidb;} else{now+=move;}
  document.getElementById("pano").style.left=now;
	tim=setTimeout("sl()",speed);}}

function stop(){clearTimeout(tim); noscroll=true}
document.write("<div id='panorama'>");
document.write("<div id='pano' style='position:absolute; left:"+imstart+"px; top:0px; width:"+imw*3+"px; height:"+imh+"px; z-index:2; visibility:visible;'>");
document.write("<table><tr><td nowrap><img src='"+impad+"' width="+imw+"px height="+imh+"px><img src='"+impad+"' width="+imw+"px height="+imh+"px><img src='"+impad+"' width="+imw+"px height="+imh+"px></td></tr></table>");
document.write("</div></div>");
document.write("<div id='left'><a href='javascript://' onmouseover='noscroll=false; sl()' onmouseout='stop()'><h1> ⇐ </a></div>");
document.write("<div id='right'><a href='javascript://' onmouseover='noscroll=false; sr()' onmouseout='stop()'><h1> ⇒ </a></div>");
document.write("<style>");
document.write("body { margin-left:0; margin-right:0; margin-top:0; margin-bottom:0;width:100%;height:100%;overflow:hidden;}");
document.write("#panorama {position:absolute; left:"+poslef+"px; top:"+postop+"px; width:"+panwid+"px; height:"+panhei+"px; z-index:1; clip:rect(0px,"+panwid+"px,"+panhei+"px,0px); overflow:hidden;}");
document.write("#left {position:absolute; left:"+conlefa+"px; top:"+contop+"px; width:"+conwid+"px; z-index:1; text-align:right;}");
document.write("#right {position:absolute; left:"+conlefb+"px; top:"+contop+"px; width:"+conwid+"px; z-index:1; text-align:left;}");
document.write("#right a, #left a {text-decoration:none;}");
document.write("</style>");
</SCRIPT><h1><a style="display:none;" href="https://www.codebazan.ir/">&#1705;&#1583;&#1576;&#1575;&#1586;&#1575;&#1606;</a></h1>

 

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *