...

View Full Version : problems with font-family in this script



hvadseth79
12-31-2003, 12:33 AM
I'd like to have Verdana font-family on this script.

This is the script where all the thumbnails are:

<script>
<!--
gallery1=new Array()
gallery1[0]=new Array("Bildervenner/1.jpg","","Bildervenner/storebilder/stor_1.jpg","Additional text can be passed to the popup window with the image - Klikk p bildet for lukke vinduet ")
gallery1[1]=new Array("pic02_tn.jpg","Image 2","pic02.jpg","")
gallery1[2]=new Array("pic03_tn.jpg","Image 3","pic03.jpg","")
gallery1[3]=new Array("pic04_tn.jpg","Image 4","pic03.jpg","")

gallery2=new Array()
gallery2[0]=new Array("pic05_tn.jpg","Image 5","pic05.jpg","Additional text can be passed to the popup window with the image.")
gallery2[1]=new Array("pic06_tn.jpg","Image 6","pic06.jpg","Images of the sea")
gallery2[2]=new Array("pic07_tn.jpg","Image 7","pic07.jpg","")
gallery2[3]=new Array("pic08_tn.jpg","Image 8","pic08.jpg","")

gallery3=new Array()
gallery3[0]=new Array("pic09_tn.jpg","Image 9","pic09.jpg","")
gallery3[1]=new Array("pic10_tn.jpg","Image 10","pic10.jpg","")
gallery3[2]=new Array("pic11_tn.jpg","Image 11","pic11.jpg","")
gallery3[3]=new Array("pic12_tn.jpg","Image 12","pic12.jpg","")

gallery4=new Array()
gallery4[0]=new Array("pic13_tn.jpg","Image 13","pic13.jpg","")
gallery4[1]=new Array("pic14_tn.jpg","Image 14","pic14.jpg","")
gallery4[2]=new Array("pic15_tn.jpg","Image 15","pic15.jpg","")
gallery4[3]=new Array("pic16_tn.jpg","Image 16","pic16.jpg","")

gallery5=new Array()
gallery5[0]=new Array("pic17_tn.jpg","Image 17","pic17.jpg","")
gallery5[1]=new Array("pic18_tn.jpg","Image 18","pic18.jpg","")
gallery5[2]=new Array("pic19_tn.jpg","Image 19","pic19.jpg","A larger Picture")
gallery5[3]=new Array("pic20_tn.jpg","Image 20","pic20.jpg","")

function showme(n){
num=n
document.getElementById("gall").innerHTML="<h1>Gallery "+n+"</h1>"
for(i=0;i<window['gallery'+n].length;i++){
document.getElementById("pic"+i).src=window['gallery' + n][i][0]
document.getElementById("div"+i).innerHTML=window['gallery' + n][i][1]
}
}


function newwin(w,p){
win_width=0 // manual window width, set to zero for auto resizing
win_height=0 // manual window height
my_image=new Image()
my_image.src=window['gallery' + num][w][2]

if(win_width==0){ // auto resize window
win_width=my_image.width+30
win_height=my_image.height+60
}

data=window['gallery' + num][w][2]
data+="="+window['gallery' + num][w][1]

if(window['gallery' + num][w].length>3){ // if additional text
data+="="+window['gallery' + num][w][3] // include to pass to popup

string_length=window['gallery' + num][w][3].length*15 // get string length at 10 pixels per character
lines_required=Math.ceil(string_length/win_width) // divide string length by window width
win_height=win_height+(lines_required*20) // multiply by height of characters and adjust window height
}

win_left = (screen.availWidth - win_width) / 2
win_top = (screen.availHeight - win_height) / 2

my_pop=window.open("img_gal_pop.htm?"+data,'popit' ,'left='+win_left+',top='+win_top+',width='+win_width+',height='+win_height+' ')
my_pop.resizeTo(win_width,win_height)
my_pop.moveTo(win_left,win_top)
my_pop.focus()
}
// -->
</script>



This is the script in the head tag in the page witch is generated by the script:

<script>
<!--
if (location.search.length > 0)
dataPassed = unescape(location.search.substring(1));
//alert(dataPassed)

temp_array=dataPassed.split("=")

document.write("<img src=\""+temp_array[0]+"\" onclick=\"self.close()\">")
document.write("<div style=\"width:100%;text-align:center\">"+temp_array[1]+"</div>")

if(temp_array.length>2){
document.write("<div>"+temp_array[2]+"</div>")
}
// -->
</script>



How can I get Verdana text on the text that comes with all the pictures?

Willy Duitt
12-31-2003, 04:17 PM
Try the changes highlighted in red:

document.write("<div style=\"width:100%;text-align:center;font-family:verdana\">"+temp_array[1]+"</div>")

.....Willy



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum