Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Invision Power Board: Javascript on the index wont work.


  • Please log in to reply

#1
Linden

Linden

    Member

  • Member
  • PipPip
  • 57 posts
Hey all,

I have a slight problem. I am trying to get this script:

<script language=JavaScript1.2>
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

var dragswitch=0
var nsx
var nsy
var nstemp

function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y

}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx
crossobj.style.top=tempy+e.clientY-offsety
return false
}
}
function initializedrag(e){
crossobj=ns6? document.getElementById("dnwtop_100_showimage") : document.all.dnwtop_100_showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "HTML" : "BODY"
while (firedobj.tagName!=topelement&&firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}
if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY
tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)
dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
function hidebox(){
if (ie4||ns6)
	crossobj.style.visibility="hidden"
else if (ns4)
	document.dnwtop_100_showimage.visibility="hide"
}
document.write('');
document.write('<div id="dnwtop_100_showimage" style="z-index: 300; position:absolute;width:380px;left:30;top:60"><table border="1" bordercolor="#000000" width="380" bgcolor="#18171c" cellspacing="0" cellpadding="0"><tr><td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0" height="36"><tr><td width="100%" background="" id="dragbar" title="you may drag me" height="25"><ilayer width="100%" onSelectStart="return false"><layer width="100%" onMouseover="dragswitch=1;if (ns4) drag_dropns(dnwtop_100_showimage)" onMouseout="dragswitch=0"><span style="font-weight: bold; font-family: Verdana; font-size: 12px; color: #00FF00;  padding-bottom: 4px; padding-left:6px; padding-right:6px; padding-top:6px">Vote for Eps WoW - XtremeTop100</span></layer></ilayer></td></tr><tr><td width="100%" bgcolor="#808080" style="padding:10px; border: solid 837932 2px; border-top:0px; font-family:Verdana; font-size:12px; color:000000;"><i><BR><center><b><a href="http://www.xtremetop100.com/in.php?site=1132209350"><img src="http://www.xtremetop100.com/votenew.jpg"><img src="http://www.xtremetop100.com/votenew.jpg"><img src="http://www.xtremetop100.com/votenew.jpg"></a><br><br> </b></i><b><i>Vote! It takes only a few seconds and we gain THOUSANDS of players from it!!</i></b><br><br><div align="center"><b><a href="http://www.xtremetop100.com/in.php?site=1132209350" target="_blank" onClick="hidebox()"><u>Vote and WIN!</u></a></b>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#"><b>I'm Lazy.</b></a><a href="#" onClick="hidebox();return false"><b>.</b></a>&nbsp;&nbsp;&nbsp;</div></td></tr></table></td></tr></table></div></center>');
</SCRIPT>
to work on the index page. I've tried it but it just won't popup :whistling:.

some how www.wowscape.net have done it...

Hellpppp meeeeee >...<

Thanks

Edited by Linden, 10 August 2007 - 07:08 AM.

  • 0

Advertisements


#2
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Which part of their page are they applying the script to so you don't have to mouseover the whole page to find it?

Ron
  • 0

#3
Linden

Linden

    Member

  • Topic Starter
  • Member
  • PipPip
  • 57 posts
<head>

		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

		<title>WoWscape :: #1 World of Warcraft Private Server</title>

		<link href="global.css" rel="stylesheet" type="text/css" media="all" />

		<meta name="author" content="WoWscape.net" />

		<meta name="copyright" content="Content Copyright WoWscape.net. All rights reserved." />

		<meta name="keywords" content="WoWscape, World of Warcraft, Servers, Dedicated, Private, World of Warcraft Private Servers, Runescape, WoWcrack, WoWcentral, WoWrevolution, Troll, Night-Elf, Horde, Alliance, Blizzard, Dwarf, Gnome, Human, Orc, Druid, Warrior" />



		<meta name="description" content="WoWscape is the largest and best World of Warcraft Private Server around! We have 2 servers, each with a cap of 1,000 users, and a constant uptime. We also host many events!" />

		<link rel="icon" href="skin_images/animated_favicon1.gif" type="image/gif">



		<script type="text/javascript" src="jscripts/ajax.js"></script>

		<script type="text/javascript" src="jscripts/jquery/jquery.js"></script>

		<script type="text/javascript" src="jscripts/jquery/idrag.js"></script>

		<script type="text/javascript" src="jscripts/jquery/imagebox.js"></script>



		<script type="text/javascript" src="jscripts/jquery/cookie.js"></script>

		<script type="text/javascript" src="jscripts/shared.js"></script>

	</head>



	<body>

		<!-- Voting Dialog (Begin) -->

		<form id="xth" action="http://www.xtremetop100.com/in.php" method="get">

			<input type="hidden" name="site" value="1132192645">



		</form>

		<div id="root" style="position: absolute; height: 203px; #height: 217px; width: 380px; -moz-user-select: none; cursor: default; left: 60px; top: 60px; background-image: url(images/vote_dialog_background.gif); border: 1px solid #2C6E8C; display: none" onselectstart="return false">

			<div id="handle" style="width: 380px; height: 25px; background-image: url('images/vote_dialog_top.gif'); font-weight: bold; font-family: Verdana; font-size: 12px; color: #dde5fa; display: table-cell; border-bottom: 1px solid #000000; cursor: move; vertical-align: middle; line-height: 24px">XtremeTop100 - World of Warcraft</div>

			<div style="padding: 10px; text-align: left; font-family: Verdana; font-size: 12px; color: #FFFFFF">

				<p align="center"><img src="skin_images/wsvote.gif"></p><br />

				<i>Help us become <b>#1</b> once again! We need <b>your</b> help to make this happen. <u>Would you like to vote for WoWscape?</u></i><br /><br />



				<div align="right">

					<input type="button" style="width: 70px; height: 25px" onclick="document.getElementById('root').style.visibility = 'hidden'; createCookie('ws_voted', 1, 12, '.wowscape.net'); document.forms['xth'].submit()" value="Yes!">&nbsp;&nbsp;&nbsp;<input type="button" style="width: 70px; height: 25px" onclick="document.getElementById('root').style.visibility = 'hidden'; return false" value="No...">

				</div>

			</div>

		</div>

		<!-- Voting Dialog (End) -->

		

		<script type="text/javascript">

			$("#root").Draggable(

				{

					handle:	"#handle"

				}

			);

			

			if ($.cookie("ws_voted") != 1) {

				$("#root").show();

			}



			$.ImageBox.init(

				{

					loaderSRC: 'images/imagebox/loading.gif',

					closeHTML: '<img src="images/imagebox/close.jpg" />'

				}

			);

		</script>

  • 0

#4
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Not what I wanted. Wanted where/what the link, image or whatever on www.wowscape.net's page that you are referring to for the JS to take effect. I want to ascertain that the JS you have is all you need.

Ron
  • 0

#5
Linden

Linden

    Member

  • Topic Starter
  • Member
  • PipPip
  • 57 posts
Ohh. When the page loads the little box is already there, you can just click okay, or no to make it go away.
  • 0

#6
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
OK. For me to get that box working as it is on the web page without getting script error(s), I needed four scripts and some code and other script from the body of the html. Since I don't know if the scripts are proprietary without further investigation, that's all the info I will provide for now.

Ron
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP