4 Replies - 719 Views - Last Post: 01 February 2010 - 05:55 PM

#1 JBroms  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 18-April 09

Trying to get an in-window calendar popup to work and seriously failin

Post icon  Posted 01 February 2010 - 05:23 PM

Well, I'm here trying to get a CalendarPopup from this js file to load without opening a new window. Based on the fact that it's not, I'm guessing my inexperience with javascript is causing me to fail in a very large way. I'm going to post my html file below, and hopefully someone can point out exactly how I should get it to appear. Thanks in advance.

<html>
  <head>
	<script src="js/utility.js">
			 </script><script src="js/CalendarPopup.js" >
			 </script><script> var cal = new CalendarPopup('cal'); 
								cal.showYearNavigation(); 
								cal.showYearNavigationInput(); </script>
			<LINK REL="stylesheet" HREF="css/main.css" TYPE="text/css" Media="screen">
  </head>
  <body>
<div id="cal">
<A NAME="test" ID="test"> </A>
<script>
cal.showCalendar(test);
</script>
</div>
</body>
</html>


Is This A Good Question/Topic? 0
  • +

Replies To: Trying to get an in-window calendar popup to work and seriously failin

#2 333OnlyHalfEvil  Icon User is offline

  • D.I.C Addict

Reputation: 24
  • View blog
  • Posts: 664
  • Joined: 20-March 09

Re: Trying to get an in-window calendar popup to work and seriously failin

Posted 01 February 2010 - 05:30 PM

We need to see your utility.js file and your calendarpopup.js file. Help us help you.

This post has been edited by 333OnlyHalfEvil: 01 February 2010 - 05:33 PM

Was This Post Helpful? 0
  • +
  • -

#3 JBroms  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 18-April 09

Re: Trying to get an in-window calendar popup to work and seriously failin

Posted 01 February 2010 - 05:43 PM

 // Javascript Document

var x,y;
var oldx,oldy;
var entDrag;

var isDragging;


function mouse(event) {
	var changey,changex, curx,cury;
	x = event.clientX;
	y = event.clientY;
	
	if (isDragging) {
		changey = entDrag.offsetTop + (y-oldy);
		changex = entDrag.offsetLeft + (x-oldx);
		entDrag.style.left = changex;
		entDrag.style.top = changey;
		oldy=y;
		oldx=x;
	} 
}

function turnHintOn(event, ent, msg, width, height) {
	if (!isDragging) {
		oldx = x;
		oldy = y;
		isDragging = true;
		entDrag = ent;
		entDrag.style.top = y + 20;
		entDrag.style.left = x - (width/2);
		entDrag.style.width = width;
		entDrag.style.height = height;
		entDrag.innerHTML = '<div id="helpinner">' + msg + '</div>';
		showEnt(ent);	
	} else {
		if (ent == entDrag) { turnHintOff(); }
	}
}

function turnHintOff() {
	if (isDragging) {	
		isDragging = false;
		hideEnt(entDrag);
		entDrag = null;
	}
}

function turnDragOn(event, ent) {
	if (!isDragging) {
		oldx = x;
		oldy = y;
		isDragging = true;
		entDrag = ent;
		ent.style.cursor = 'move';
	}
}

function turnDragOff() {
	isDragging = false;
	entDrag.style.cursor = 'cursor';
	entDrag = null;
}

function hideEnt(ent) {
	ent.style.display = 'none';
}

function showEnt(ent) {
	ent.style.display = 'block';
}

function entity(n, d) { //v4.01
					  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
						d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
					  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
					  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
					  if(!x && d.getElementById) x=d.getElementById(n); return x;
					}
					
					 
function changeimage(ent,filename) { ent.src='images/' + filename; }
function changeclass(ent, classname) { ent.className = classname; }
function callbackManualReturn(ent) {
	ent.innerHTML = r['callback'][ent.id].responseText;
}

I didn't think the utility file was needed, as its from a completely different source than the CalendarPopup.js file (which is in the link I provided)
Was This Post Helpful? 0
  • +
  • -

#4 333OnlyHalfEvil  Icon User is offline

  • D.I.C Addict

Reputation: 24
  • View blog
  • Posts: 664
  • Joined: 20-March 09

Re: Trying to get an in-window calendar popup to work and seriously failin

Posted 01 February 2010 - 05:50 PM

If it's not needed than why are you using it?
Was This Post Helpful? 0
  • +
  • -

#5 JBroms  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 18-April 09

Re: Trying to get an in-window calendar popup to work and seriously failin

Posted 01 February 2010 - 05:55 PM

View Post333OnlyHalfEvil, on 1 Feb, 2010 - 04:50 PM, said:

If it's not needed than why are you using it?

I planned on using it later, once I got going, but I never managed to get the Calendar to work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1