
08-02-2012, 15:04:08
|
| |
Javascript çakışması | | Arkadaşlar drupal siteme ik adet javascript ekledim fakat çakışma oluyor sebebini anlamadım.
1. Slaty için olanı Kod: <center><h4 style="color: rgb(0, 51, 153);">Sponsor</h4>
<script language="JavaScript1.2">
var slideshow_width='190px' //SET SLIDESHOW WIDTH (set to largest image's width if multiple dimensions exist)
var slideshow_height='50px' //SET SLIDESHOW HEIGHT (set to largest image's height if multiple dimensions exist)
var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)
var slidebgcolor="white"
var dropimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
dropimages[0]="/images/1.gif"
dropimages[1]="/images/2.gif"
var droplinks=new Array()
//SET IMAGE URLs. Use "" if you wish particular image to NOT be linked:
droplinks[0]="http://homepage.asp"
droplinks[1]="http://index.php"
////NO need to edit beyond here/////////////
var preloadedimages=new Array()
for (p=0;p<dropimages.length;p++){
preloadedimages[p]=new Image()
preloadedimages[p].src=dropimages[p]
}
var ie4=document.all
var dom=document.getElementById
if (ie4||dom)
document.write('<div style="position:relative;width:'+slideshow_width+';height:'+slideshow_height+';overflow:hidden"><div id="canvas0" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';background-color:'+slidebgcolor+';left:-'+slideshow_width+'"></div><div id="canvas1" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';background-color:'+slidebgcolor+';left:-'+slideshow_width+'"></div></div>')
else
document.write('<a href="javascript:rotatelink()"><img name="defaultslide" src="'+dropimages[0]+'" border=0></a>')
var curpos=parseInt(slideshow_width)*(-1)
var degree=10
var curcanvas="canvas0"
var curimageindex=linkindex=0
var nextimageindex=1
function movepic(){
if (curpos<0){
curpos=Math.min(curpos+degree,0)
tempobj.style.left=curpos+"px"
}
else{
clearInterval(dropslide)
nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
var slideimage='<img src="'+dropimages[curimageindex]+'" border=0>'
tempobj.innerHTML=(droplinks[curimageindex]!="")? '<a href="'+droplinks[curimageindex]+'">'+slideimage+'</a>' : slideimage
nextimageindex=(nextimageindex<dropimages.length-1)? nextimageindex+1 : 0
setTimeout("rotateimage()",pause)
}
}
function rotateimage(){
if (ie4||dom){
resetit(curcanvas)
var crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.style.zIndex++
var temp='setInterval("movepic()",50)'
dropslide=eval(temp)
curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
}
else
document.images.defaultslide.src=dropimages[curimageindex]
linkindex=curimageindex
curimageindex=(curimageindex<dropimages.length-1)? curimageindex+1 : 0
}
function rotatelink(){
if (droplinks[linkindex]!="")
window.location=droplinks[linkindex]
}
function resetit(what){
curpos=parseInt(slideshow_width)*(-1)
var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
crossobj.style.left=curpos+"px"
}
function startit(){
var crossobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.innerHTML='<a href="'+droplinks[curimageindex]+'"><img src="'+dropimages[curimageindex]+'" border=0></a>'
rotateimage()
}
if (ie4||dom)
window.onload=startit
else
setInterval("rotateimage()",pause)
</script>
</center> 2. Geriye zaman scripti Kod: <SCRIPT language=JavaScript1.2>function setcountdown(theyear,themonth,theday){
yr=theyear;mo=themonth;da=theday
}
//////////CONFIGURE THE COUNTDOWN SCRIPT HERE//////////////////
//STEP 1: Configure the countdown-to date, in the format year, month, day:
setcountdown(2012,03,09)
//STEP 2: Change the two text below to reflect the occasion, and message to display on that occasion, respectively
var occasion=" "
var message_on_occasion=""
//STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countdown area
var countdownwidth='150'
var countdownheight='0px'
var countdownbgcolor=''
var opentags=''
var closetags=''
//////////DO NOT EDIT PASS THIS LINE//////////////////
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var crosscount=''
function start_countdown(){
if (document.layers)
document.countdownnsmain.visibility="show"
else if (document.all||document.getElementById)
//crosscount=document.getElementById&&!document.all?document.getElementById("countdownie") : countdownie
countdown()
}
if (document.all||document.getElementById)
//document.write('<span id="countdownie""></span>')
window.onload=start_countdown
function countdown(){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
//if on day of occasion
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da){
if (document.layers){
//document.countdownnsmain.document.countdownnssub.document.write(opentags+message_on_occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+message_on_occasion+closetags
return
}
//if passed day of occasion
else if (dday<=-1){
if (document.layers){
//document.countdownnsmain.document.countdownnssub.document.write(opentags+" "+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+" Etkinlik "+closetags
return
}
//else, if not yet
else{
if (document.layers){
document.getElementById("days").innerHTML=opentags+dday;
document.getElementById("hours").innerHTML=dhour;
document.getElementById("days").innerHTML=dmin;
//document.countdownnsmain.document.countdownnssub.document.write(opentags+dday+ " gün,"+dhour+"saat, "+dmin+" dakika,"+dsec+"sn"+occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
document.getElementById("days").innerHTML=dday;
document.getElementById("hours").innerHTML=dhour;
document.getElementById("min").innerHTML=dmin;
//crosscount.innerHTML=opentags+dday+ " gün, " +dhour+ " saat, " +dmin+ " dakika, " +dsec+ "sn" +occasion+closetags
}
setTimeout("countdown()",1000)
}
</SCRIPT>
<table align="center" width="180" cellspacing="3" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" width="60" height="30">
<h4>GÜN</h4>
</td>
<td align="center" width="60">
<h4>SAAT</h4>
</td>
<td align="center" width="60">
<h4>DAKİKA</h4>
</td>
</tr>
<tr class="cell">
<td height="30" id="days">--</font></td>
<td id="hours">--</td>
<td id="min">--</td>
</tr>
</tbody>
</table> arkadaşlar sorunu çözemedim yardımcı olursanız sevinirim. |