...

View Full Version : How do I remove the var messageurl = from javascript



webwitch
12-05-2004, 11:12 AM
Hello

I've tried to remove the text links from an image slideshow script according to the authors instructions but the text remains live and linked to the address of the page you are veiwing but with the symbol after like this http://www.notarealaddress.com/#

I want to get rid of the url var all together if it is possible so I am hoping someone here may have a solution. I've emailed the author of the script already but don't know when I'll hear back from him and I am anxious to fix it as the glitch degrades the otherwise perfect script.

var messageurl = new Array()
messageurl[0]="#"
messageurl[1]="#"
messageurl[2]="#"
messageurl[3]="#"
messageurl[4]="#"
messageurl[5]="#"
messageurl[6]="#"

Thanks in advance for your help
Webwitch

Badman3k
12-05-2004, 09:33 PM
Well I'd try removing the whole array, however this is more than likely to cause a problem later on in the code. If you post the whole code we could remove/modify it, so that it no longer makes the links.

Unfortunately at the mo, we can't do this, as we don't have the code.

webwitch
12-06-2004, 02:55 AM
Thanks for getting back to me Rich. Here's the whole code. Hope you can help me out.

<style>
.s {LEFT: -5000px; POSITION: absolute; topt: -5000px}
A {TEXT-DECORATION: none}
</style>

<SCRIPT>
<!-- Beginning of JavaScript -
// Edit your messages. You can add as many messages a you like.
var message = new Array()
message[0]="Weaving Magic Websites Cutting Edge Custom Website Design"
message[1]="Weaving Magic Websites Where Creativity and Technology Meet"
message[2]="Weaving Magic Websites Showcasing Your Business In Style"
message[3]="Fast Reliable In House Website Hosting Free Setup Multiple Emails"
message[4]="Digital Photography Graphic and Logo Design Copy Writing"
message[5]="Digitly Enhancing Your Business Image Keeping Pace with Todays Marketplace"
message[6]="Optimizing Search Engine Visibility Targeting Your Commercial Audience"
// The links of your messages. Be sure that you configure as many links as messages.
// If you don't want to link a message write '#' instead of an URL.
var messageurl = new Array()
messageurl[0]="#"
messageurl[1]="#"
messageurl[2]="#"
messageurl[3]="#"
messageurl[4]="#"
messageurl[5]="#"
messageurl[6]="#"
// The images for your messages.
var messageimg = new Array()
messageimg[0]="images/pic1xx.gif"
messageimg[1]="images/pic2xx.gif"
messageimg[2]="images/pic3xx.gif"
messageimg[3]="images/pic4xx.gif"
messageimg[4]="images/pic14xx.gif"
messageimg[5]="images/pic13xx.gif"
messageimg[6]="images/pic5xx.gif"
// Alignment for each image in relation to its message-text (right or left)
var alignimg=new Array()
alignimg[0]="left"
alignimg[1]="left"
alignimg[2]="left"
alignimg[3]="left"
alignimg[4]="left"
alignimg[5]="left"
alignimg[6]="left"
// Alignment for message in relation to the margin of the messagebox
var alignmessage=new Array()
alignmessage[0]="right"
alignmessage[1]="right"
alignmessage[2]="right"
alignmessage[3]="right"
alignmessage[4]="right"
alignmessage[5]="right"
alignmessage[6]="right"
// target of the message-links (HTML conventions)
var target_url="_top"

// The width of your ticker
var textwidth=300
// The height of your ticker
var textheight=100
// The borderwidth of your ticker
var borderwidth=0
// The size of the font (HTML3 conventions)
var font_size=2
// font-face
var font_face="Verdana, Arial, Helvetica, sans-serif"
// font-color
var font_color="#ffffff"
// background-color of the ticker
var bg_ticker="black"
// The horizontal position of the messagebox: distance to the left margin of the window
var x_finalpos=475
// The vertical position of the messagebox: distance to the top margin of the window
var y_finalpos=0
// Number of lamellas.
var x_slices=12
// Pause beween the messages (milliseconds)
var pause=2000
// Do not change the variables below this line
var imgpreload=new Array()
for (i=0;i<=messageimg.length-1;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=messageimg[i]
}
var i_loop=0
var i_message=0
var width_slice=Math.ceil(textwidth/x_slices)





var cliptop=0
var clipbottom=textheight
var i_clipright=1
var content=""
function initiate() {
content+="<table border="+borderwidth+" cellpadding='5' width="+textwidth+" height="+textheight+">"
content+="<tr><td bgcolor="+bg_ticker+" align="+alignmessage[i_message]+">"
content+="<img hspace=5 src="+messageimg[i_message]+" align="+alignimg[i_message]+" border='0'>"
content+="<a href="+messageurl[i_message]+" target="+target_url+">"
content+="<font face="+font_face+" size="+font_size+" color="+font_color+">"
content+=message[i_message]
content+="</font></a></td></tr></table>"
if (document.all) {
for (i=0;i<=x_slices;i++) {
var thisinners=eval("s"+i)
thisinners.innerHTML=content
var thiss=eval("document.all.s"+i+".style")
thiss.posLeft=x_finalpos
thiss.posTop=y_finalpos
}
i_message++
openlamellar()
}
if (document.layers) {
for (i=0;i<=x_slices;i++) {
var thisinners=eval("document.s"+i+".document")
thisinners.write(content)
thisinners.close()
var thiss=eval("document.s"+i)
thiss.left=x_finalpos
thiss.top=y_finalpos
}
i_message++
openlamellarNN()
}
}
function openlamellar() {
clipleft=-width_slice
clipright=0
if (i_clipright<=width_slice) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.all.s"+i+".style")
thiss.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright++
var timer=setTimeout("openlamellar()",20)
}
else {
clearTimeout(timer)
var timer=setTimeout("closelamellar()",3000)
}
}
function openlamellarNN() {
clipleft=-width_slice
clipright=0
if (i_clipright<=width_slice) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.s"+i)
thiss.clip.left=clipleft
thiss.clip.right=clipright
thiss.clip.top=cliptop
thiss.clip.bottom=clipbottom
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright++
var timer=setTimeout("openlamellarNN()",20)
}
else {
clearTimeout(timer)
var timer=setTimeout("closelamellarNN()",3000)
}
}
function closelamellar() {
clipleft=-width_slice
clipright=0
if (i_clipright>=0) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.all.s"+i+".style")
thiss.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright--
var timer=setTimeout("closelamellar()",20)

}
else {
clearTimeout(timer)
var timer=setTimeout("changeimage()",1000)
}
}
function closelamellarNN() {
clipleft=-width_slice
clipright=0
if (i_clipright>=0) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.s"+i)
thiss.clip.left=clipleft
thiss.clip.right=clipright
thiss.clip.top=cliptop
thiss.clip.bottom=clipbottom
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright--
var timer=setTimeout("closelamellarNN()",20)

}
else {
clearTimeout(timer)
var timer=setTimeout("changeimageNN()",1000)
}
}
function changeimage() {
content=""
if (i_message>message.length-1) {i_message=0}
content+="<table border="+borderwidth+" cellpadding='5' width="+textwidth+" height="+textheight+">"
content+="<tr><td bgcolor="+bg_ticker+" align="+alignmessage[i_message]+">"
content+="<img hspace=5 src="+messageimg[i_message]+" align="+alignimg[i_message]+" border='0'>"
content+="<a href="+messageurl[i_message]+" target="+target_url+">"
content+="<font face="+font_face+" size="+font_size+" color="+font_color+">"
content+=message[i_message]
content+="</font></a></td></tr></table>"
for (i=0;i<=x_slices;i++) {
var thisinners=eval("s"+i)
thisinners.innerHTML=content
}
i_message++
openlamellar()
}
function changeimageNN() {
content=""
if (i_message>message.length-1) {i_message=0}
content+="<table border="+borderwidth+" cellpadding='5' width="+textwidth+" height="+textheight+">"
content+="<tr><td bgcolor="+bg_ticker+" align="+alignmessage[i_message]+">"
content+="<img hspace=5 src="+messageimg[i_message]+" align="+alignimg[i_message]+" border='0'>"
content+="<a href="+messageurl[i_message]+" target="+target_url+">"
content+="<font face="+font_face+" size="+font_size+" color="+font_color+">"
content+=message[i_message]
content+="</font></a></td></tr></table>"
for (i=0;i<=x_slices;i++) {
var thisinners=eval("document.s"+i+".document")
thisinners.write(content)
thisinners.close()
}
i_message++
openlamellarNN()
}
// - End of JavaScript - -->
</SCRIPT>

<SCRIPT>
<!-- Beginning of JavaScript -
for (i=0;i<=x_slices;i++) {
document.write("<span id='s"+i+"' class='s'></span>")
}
// - End of JavaScript - --></SCRIPT>

Webwitch

Badman3k
12-06-2004, 08:47 AM
I've assumed that you want the message to be displayed for the image, but just don't want it to be a link. I've removed the thing I said earlier and then also edited the functions initiate, changeimage() and changeimageNN() to remove the use of link tags (and the user of the array. The code below should work, although I've not had chance to test it.



<style>
.s {LEFT: -5000px; POSITION: absolute; topt: -5000px}
A {TEXT-DECORATION: none}
</style>

<SCRIPT>
<!-- Beginning of JavaScript -
// Edit your messages. You can add as many messages a you like.
var message = new Array()
message[0]="Weaving Magic Websites Cutting Edge Custom Website Design"
message[1]="Weaving Magic Websites Where Creativity and Technology Meet"
message[2]="Weaving Magic Websites Showcasing Your Business In Style"
message[3]="Fast Reliable In House Website Hosting Free Setup Multiple Emails"
message[4]="Digital Photography Graphic and Logo Design Copy Writing"
message[5]="Digitly Enhancing Your Business Image Keeping Pace with Todays Marketplace"
message[6]="Optimizing Search Engine Visibility Targeting Your Commercial Audience"
// The images for your messages.
var messageimg = new Array()
messageimg[0]="images/pic1xx.gif"
messageimg[1]="images/pic2xx.gif"
messageimg[2]="images/pic3xx.gif"
messageimg[3]="images/pic4xx.gif"
messageimg[4]="images/pic14xx.gif"
messageimg[5]="images/pic13xx.gif"
messageimg[6]="images/pic5xx.gif"
// Alignment for each image in relation to its message-text (right or left)
var alignimg=new Array()
alignimg[0]="left"
alignimg[1]="left"
alignimg[2]="left"
alignimg[3]="left"
alignimg[4]="left"
alignimg[5]="left"
alignimg[6]="left"
// Alignment for message in relation to the margin of the messagebox
var alignmessage=new Array()
alignmessage[0]="right"
alignmessage[1]="right"
alignmessage[2]="right"
alignmessage[3]="right"
alignmessage[4]="right"
alignmessage[5]="right"
alignmessage[6]="right"
// target of the message-links (HTML conventions)
var target_url="_top"

// The width of your ticker
var textwidth=300
// The height of your ticker
var textheight=100
// The borderwidth of your ticker
var borderwidth=0
// The size of the font (HTML3 conventions)
var font_size=2
// font-face
var font_face="Verdana, Arial, Helvetica, sans-serif"
// font-color
var font_color="#ffffff"
// background-color of the ticker
var bg_ticker="black"
// The horizontal position of the messagebox: distance to the left margin of the window
var x_finalpos=475
// The vertical position of the messagebox: distance to the top margin of the window
var y_finalpos=0
// Number of lamellas.
var x_slices=12
// Pause beween the messages (milliseconds)
var pause=2000
// Do not change the variables below this line
var imgpreload=new Array()
for (i=0;i<=messageimg.length-1;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=messageimg[i]
}
var i_loop=0
var i_message=0
var width_slice=Math.ceil(textwidth/x_slices)





var cliptop=0
var clipbottom=textheight
var i_clipright=1
var content=""
function initiate() {
content+="<table border="+borderwidth+" cellpadding='5' width="+textwidth+" height="+textheight+">"
content+="<tr><td bgcolor="+bg_ticker+" align="+alignmessage[i_message]+">"
content+="<img hspace=5 src="+messageimg[i_message]+" align="+alignimg[i_message]+" border='0'>"
content+="<font face="+font_face+" size="+font_size+" color="+font_color+">"
content+=message[i_message]
content+="</font></td></tr></table>"
if (document.all) {
for (i=0;i<=x_slices;i++) {
var thisinners=eval("s"+i)
thisinners.innerHTML=content
var thiss=eval("document.all.s"+i+".style")
thiss.posLeft=x_finalpos
thiss.posTop=y_finalpos
}
i_message++
openlamellar()
}
if (document.layers) {
for (i=0;i<=x_slices;i++) {
var thisinners=eval("document.s"+i+".document")
thisinners.write(content)
thisinners.close()
var thiss=eval("document.s"+i)
thiss.left=x_finalpos
thiss.top=y_finalpos
}
i_message++
openlamellarNN()
}
}
function openlamellar() {
clipleft=-width_slice
clipright=0
if (i_clipright<=width_slice) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.all.s"+i+".style")
thiss.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright++
var timer=setTimeout("openlamellar()",20)
}
else {
clearTimeout(timer)
var timer=setTimeout("closelamellar()",3000)
}
}
function openlamellarNN() {
clipleft=-width_slice
clipright=0
if (i_clipright<=width_slice) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.s"+i)
thiss.clip.left=clipleft
thiss.clip.right=clipright
thiss.clip.top=cliptop
thiss.clip.bottom=clipbottom
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright++
var timer=setTimeout("openlamellarNN()",20)
}
else {
clearTimeout(timer)
var timer=setTimeout("closelamellarNN()",3000)
}
}
function closelamellar() {
clipleft=-width_slice
clipright=0
if (i_clipright>=0) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.all.s"+i+".style")
thiss.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright--
var timer=setTimeout("closelamellar()",20)

}
else {
clearTimeout(timer)
var timer=setTimeout("changeimage()",1000)
}
}
function closelamellarNN() {
clipleft=-width_slice
clipright=0
if (i_clipright>=0) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.s"+i)
thiss.clip.left=clipleft
thiss.clip.right=clipright
thiss.clip.top=cliptop
thiss.clip.bottom=clipbottom
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright--
var timer=setTimeout("closelamellarNN()",20)

}
else {
clearTimeout(timer)
var timer=setTimeout("changeimageNN()",1000)
}
}
function changeimage() {
content=""
if (i_message>message.length-1) {i_message=0}
content+="<table border="+borderwidth+" cellpadding='5' width="+textwidth+" height="+textheight+">"
content+="<tr><td bgcolor="+bg_ticker+" align="+alignmessage[i_message]+">"
content+="<img hspace=5 src="+messageimg[i_message]+" align="+alignimg[i_message]+" border='0'>"
content+="<font face="+font_face+" size="+font_size+" color="+font_color+">"
content+=message[i_message]
content+="</font></td></tr></table>"
for (i=0;i<=x_slices;i++) {
var thisinners=eval("s"+i)
thisinners.innerHTML=content
}
i_message++
openlamellar()
}
function changeimageNN() {
content=""
if (i_message>message.length-1) {i_message=0}
content+="<table border="+borderwidth+" cellpadding='5' width="+textwidth+" height="+textheight+">"
content+="<tr><td bgcolor="+bg_ticker+" align="+alignmessage[i_message]+">"
content+="<img hspace=5 src="+messageimg[i_message]+" align="+alignimg[i_message]+" border='0'>"
content+="<font face="+font_face+" size="+font_size+" color="+font_color+">"
content+=message[i_message]
content+="</font></td></tr></table>"
for (i=0;i<=x_slices;i++) {
var thisinners=eval("document.s"+i+".document")
thisinners.write(content)
thisinners.close()
}
i_message++
openlamellarNN()
}
// - End of JavaScript - -->
</SCRIPT>

<SCRIPT>
<!-- Beginning of JavaScript -
for (i=0;i<=x_slices;i++) {
document.write("<span id='s"+i+"' class='s'></span>")
}
// - End of JavaScript - --></SCRIPT>


Hope this helps.

webwitch
12-06-2004, 09:06 AM
Hi Rich

I really do appreciate your help. I've been working on it too I found that if I left this in

var messageurl = new Array()
messageurl[0]="#"
messageurl[1]="#"
messageurl[2]="#"
messageurl[3]="#"
messageurl[4]="#"
messageurl[5]="#"
messageurl[6]="#"

and took this out

content+="<a href="+messageurl[i_message]+" target="+target_url+">"

where it occurs three times in the script that it now works the way I want it to.

I tried your fix and unfortunately it didn't work, just ended up error on page and nothing showed where it should. I'm not sure but I think the trick is to leave the var messageurl = new Array ().

Thanks again for your help. Hopefully I can help you with something one day.
Webwitch



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum