/    Sign up×
Community /Pin to ProfileBookmark

Opening a new window within this script

[code]<script type=”text/javascript”>

//configure path for left and right arrows
var goleftimage=’pointerleft.gif’
var gorightimage=’pointerright.gif’
//configure menu width (in px):
var menuwidth=400
//configure menu height (in px):
var menuheight=25
//Specify scroll buttons directions (“normal” or “reverse”):
var scrolldir=”reverse”
//configure scroll speed (1-10), where larger is faster
var scrollspeed=6
//specify menu content
var menucontents='<nobr><b> [SIZE=4][B]Here is where I want to to have a link to a new window [/B] [/SIZE] </b></nobr>’

////NO NEED TO EDIT BELOW THIS LINE////////////

var iedom=document.all||document.getElementById
var leftdircode=’onMouseover=”moveleft()” onMouseout=”clearTimeout(lefttime)”‘
var rightdircode=’onMouseover=”moveright()” onMouseout=”clearTimeout(righttime)”‘
if (scrolldir==”reverse”){
var tempswap=leftdircode
leftdircode=rightdircode
rightdircode=tempswap
}
if (iedom)
document.write(‘<span id=”temp” style=”visibility:hidden;position:absolute;top:-100;left:-5000″>’+menucontents+'</span>’)
var actualwidth=”
var cross_scroll, ns_scroll
var loadedyes=0
function fillup(){
if (iedom){
cross_scroll=document.getElementById? document.getElementById(“test2”) : document.all.test2
cross_scroll.innerHTML=menucontents
actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById(“temp”).offsetWidth
}
else if (document.layers){
ns_scroll=document.ns_scrollmenu.document.ns_scrollmenu2
ns_scroll.document.write(menucontents)
ns_scroll.document.close()
actualwidth=ns_scroll.document.width
}
loadedyes=1
}
window.onload=fillup

function moveleft(){
if (loadedyes){
if (iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth)){
cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+”px”
}
else if (document.layers&&ns_scroll.left>(menuwidth-actualwidth))
ns_scroll.left-=scrollspeed
}
lefttime=setTimeout(“moveleft()”,50)
}

function moveright(){
if (loadedyes){
if (iedom&&parseInt(cross_scroll.style.left)<0)
cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+”px”
else if (document.layers&&ns_scroll.left<0)
ns_scroll.left+=scrollspeed
}
righttime=setTimeout(“moveright()”,50)
}

if (iedom||document.layers){
with (document){
write(‘<table border=”0″ cellspacing=”0″ cellpadding=”2″>’)
write(‘<td valign=”middle”><a href=”#” ‘+leftdircode+’><img src=”‘+goleftimage+'”border=0></a> </td>’)
write(‘<td width=”‘+menuwidth+’px” valign=”top”>’)
if (iedom){
write(‘<div style=”position:relative;width:’+menuwidth+’px;height:’+menuheight+’px;overflow:hidden;”>’)
write(‘<div id=”test2″ style=”position:absolute;left:0;top:0″>’)
write(‘</div></div>’)
}
else if (document.layers){
write(‘<ilayer width=’+menuwidth+’ height=’+menuheight+’ name=”ns_scrollmenu”>’)
write(‘<layer name=”ns_scrollmenu2″ left=0 top=0></layer></ilayer>’)
}
write(‘</td>’)
write(‘<td valign=”middle”> <a href=”#” ‘+rightdircode+’>’)
write(‘<img src=”‘+gorightimage+'”border=0></a>’)
write(‘</td></table>’)
}
}

</script>[/code]

I’m trying to create links to a new window from within this script. I’ve highlighted where on the script. I can’t seem to get it to do it. I’ve been at it a while and am probably missing something, can anyone give me a hand?

thanks

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @dfgh spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.14,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...