SitePoint Sponsor |
|
User Tag List
Results 1 to 14 of 14
Thread: javascript - css
-
Mar 19, 2001, 12:17 #1
- Join Date
- Nov 2000
- Posts
- 164
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hello all.
I have a project I am working on where I have a form, when I click on the form it opens up a small window with a description of what is wanted. This works perfectly for Netscape, but it doesn't work with Internet Explorer 5 - 5.5.
Does anyone know of any documentation that covers differences between Netscape and IE, accessing css variables and changing content within a css defined object.
My problem is this.
/ this was triggered by the HREF and can not be treated as an event
if ((isNS4 && currElem != 0) || (isIE4 && currElem != 0)){
dom = eval(docObj + '.' + currElem + styleObj);
state = dom.visibility;
It says the error is that state = dom.visibility; is either null or not defined. Does anyone have any ideas.
Thanks
-
Mar 20, 2001, 10:07 #2
- Join Date
- Jul 2000
- Location
- Singapore
- Posts
- 2,103
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Netscape 4 or 6?
What are you trying to achieve anyway?
Just open the form with the results in a new window?
Could you show us an example, or just a snipplet?
there might be alternative methods if we can't resolve your code problems."Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
-
Mar 20, 2001, 13:27 #3
- Join Date
- Nov 2000
- Posts
- 164
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It works in 4.7 but not in 6. I think it used to work in earlier version IE, like 4.5, but not in 5.
I guess I just want some ideas of what changes were made concerning css and javascript.
The objective of the code, is a form, and when you click on the text area of the form, or any other area (example, name: a box is there) a dhtml window will open and explain what is needed in the box.
I Thank everyone in advanced.
-
Mar 20, 2001, 18:15 #4
- Join Date
- Jul 2000
- Location
- Singapore
- Posts
- 2,103
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Oh..hmm...show us the code?
You could use javascript alerts...but could be a little annoying..
you using the element : onFocus?"Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
-
Mar 21, 2001, 10:46 #5
- Join Date
- Nov 2000
- Posts
- 164
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This is going to be a bit long,
-----------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Vendor Information Form</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; U) [Netscape]">
<META NAME="Classification" CONTENT="policy">
<script language="JavaScript1.1" src="../../jscript/common.js">
document.write("A required file was not able to load. Please contact the Support Center
and report a COMMOM-JS file load error.");
</script>
<script language="JavaScript1.2">
/* Browser sensing */
/* Set up boolian variables to record the browser type */
var isNS4 = 0;
var isNS3 = 0;
var isIE4 = 0;
var isIE3 = 0;
var isOld = 0;
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
// Set up other variables
var docObj;
var styleObj;
var topVal;
/* Determines the browser name and browser version */
var brow = ((navigator.appName) + (parseInt(navigator.appVersion)));
if (ns4) {isNS4 = 1;}
if (ie4) {isIE4 = 1;}
if (!ns4||!ie4) {isOld = 1;}
// initalizes our Generic DOM based on the browser
if (isNS4||isIE4){
docObj = (isNS4) ? 'document' : 'document.all';
styleObj = (isNS4) ? '' : '.style';
}
NS4 = document.layers;
if (NS4) {
origWidth = innerWidth;
origHeight = innerHeight;
}
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if (NS4) onresize = reDo;
// if(document.layers){origWidth=innerWidth;origHeight=innerHeight;onresize=function(){if(innerWidth!=origWidth||innerHeight!=origHeight)location.reload()}}
function glossPop(evt,currElem){
// checks to see if this is a DHTML browser
// and that currElem is not set to 0 in which case
// this was triggered by the HREF and can not be treated as an event
if ((isNS4 && currElem != 0) || (isIE4 && currElem != 0)){
dom = eval(docObj + '.' + currElem + styleObj);
state = dom.visibility;
if (state == "visible" || state == "show")
{dom.visibility = "hidden";}
else
// finds the position of the mouse
// and then offsets the coordinates slightly
{
if (currElem=="hpc") {
if (isNS4) {
topVal = eval(evt.pageY - 90); // + 170 if below
leftVal = eval(evt.pageX - 125);}
if (isIE4) {
topVal = eval(event.y - 90);
leftVal = eval(event.x - 125);}
} else {
if (isNS4) {
topVal = eval(evt.pageY + 2);
leftVal = eval(evt.pageX - 125);}
if (isIE4) {
topVal = eval(event.y + 2);
leftVal = eval(event.x - 125);}
}
// keeps the element from going off screen tothe left
if(leftVal < 2) {leftVal = 2;}
if(leftVal > 275) {leftVal = 300;}
if(topVal > 265) {topVal = topVal - 150;}
//dom.top = topVal;
//dom.left = leftVal;
dom.visibility = "visible";
}
}
}
</script>
<style>
#requestorName { position: absolute; visibility: hidden; z-index: 10; top: 125px; width: 200px; left: 0px; background-color: #F0FFF0; layer-background-color: #F0FFF0; border-color: NAVY; border-width: 2px; font-size: 8pt; font-family: Arial, sans-serif; }
#masterData { position: absolute; visibility: hidden; z-index: 10; top: 150px; width: 200px; left: 0px; background-color: #F0FFF0; layer-background-color: #F0FFF0; border-color: NAVY; border-width: 2px; font-size: 8pt; font-family: Arial, sans-serif; }
</style>
</HEAD>
<!--<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000080" VLINK="#800000" ALINK="#408080"
onLoad="changeMenu('elSupply','elSupplyChild','btn-mmform','h_supplymanagement.gif','../supplymanagement/supplymenu.htm','Supply Management Forms','../../')">
-->
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000080" VLINK="#800000" ALINK="#408080">
<DIV ID="bodyArea">
<FORM onSubmit="return submitIt(this)" ACTION="/cgi-bin/mmformmailer.pl" NAME="Vendor Information Form" METHOD="POST">
-------------------------------
I guess this is all that is really needed, each INPUT Type, when touched opens up a small descriptive window. Now the problem lies under the glosspop() function, the dom.visibility, the error is that it is not an object or it is null.
Thanks
-
Mar 21, 2001, 18:40 #6
- Join Date
- Jul 2000
- Location
- Singapore
- Posts
- 2,103
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I don't get you.
if you want to open a window when an input type is selected,
you do something like:
<input type="text" name="example" onFocus="window.open(......)">"Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
-
Mar 21, 2001, 21:32 #7
- Join Date
- Nov 2000
- Posts
- 164
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I am not trying to open a window, I am trying to open a dialog box. When you are at a site, and they have menu that when you put your mouse over the menu title, a little box opens with the sub options to choose from, same kind of concept. When a use clicks on one of the fields, a discriptive box comes up telling the user what each field represents.
-
Mar 22, 2001, 07:45 #8
- Join Date
- Jul 2000
- Location
- Singapore
- Posts
- 2,103
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Oh. Hmm....Sorry. Can't figure a way out.
Not well verse in your problem.
my apologies."Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
-
Mar 22, 2001, 08:28 #9
- Join Date
- Feb 2001
- Location
- Dùn Éideann, Alba
- Posts
- 72
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I think you're wanting to show a layer on mouseover, not a window, so when you mouse out the layer hides!
Is this what you want?
-
Mar 22, 2001, 08:32 #10
- Join Date
- Jul 2000
- Location
- Singapore
- Posts
- 2,103
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If its layer, I have a code that might help =)
"Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
-
Mar 22, 2001, 15:45 #11
- Join Date
- Nov 2000
- Posts
- 164
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Sorry about confusing everyone, yes, I want to show a layer on a mouse over, it does work though but only with Netscape, I am trying to make it work for IE5 or 5.5, and it doesn't work.
Like it says above,
-
Mar 22, 2001, 18:48 #12
- Join Date
- Jul 2000
- Location
- Singapore
- Posts
- 2,103
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You have to use iLayer?
Can you show us an example? Then I'll try to modify my script for your usage.
Thanks"Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
-
Mar 23, 2001, 10:13 #13
- Join Date
- Nov 2000
- Posts
- 164
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What are iLayres, I have heard of layers before but how are iLayers different. As well I just wanted to know what differences their were with Internet explorer compared to Netscape when dealing with layers, and javascript.
-
Mar 23, 2001, 10:36 #14
- Join Date
- Jul 2000
- Location
- Singapore
- Posts
- 2,103
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:<ilayer id="d1" width="400" height="250" visibility="hide"> </ilayer>
"Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
Bookmarks