Topic:Frontpage! Remainpoint:0
   
PostTime:12/16/2008 7:44:44 PM FloorTop
Lv is 1
Avatar
Level:
1
Professional point:
48
Experience:
8
Thread:
292
Post:
962
Total online time:
8M
Joined date:
4/28/2007 11:08:00 PM
Last Visit:
12/17/2008 12:44:40 AM
Status:
Offline
hey again everybody. I'm working on this website for my school and i have a page with a contact form on it. i also have a letter clipart outside the form area. what i have been trying to do, unsuccessfully, is to set up a DHTML effect so that when the user clicks on the "Sumbit" button, the letter flies off. Is there any way to do that? Thanks

Christian K.
 
     
   
Gender PostTime:12/16/2008 7:58:59 PM Point:0 | Floor# 1
Lv is 1
portrait
Level:
1
Professional point:
71
Experience:
5
Thread:
316
Post:
950
Total online time:
5M
Joined date:
4/28/2007 10:49:00 PM
Last Visit:
12/16/2008 11:39:24 PM
Status:
Offline
hi Christian....

what is the action of your submit???

normally, a form submits.... and an action occurs (like submitting to a different page).

I'm not going to say that you can't have the action also fire a different event (such as moving an object on the page)....
but if the form is submitting.... the objects on the form page won't matter much once the user submits the form.

I can provide you with some code..... but I don't think that it is applicable to be used with an onSubmit action.

Give me a sec to type it out.....
then you can apply it to whatever action you want to attach it to (although.... like I said.... a form submission does not seem to be the proper event for it)

give me a sec...........................
 
     
   
Gender PostTime:12/16/2008 10:29:30 PM Point:0 | Floor# 2
Lv is 1
portrait
Level:
1
Professional point:
0
Experience:
11
Thread:
265
Post:
940
Total online time:
11M
Joined date:
4/28/2007 10:35:00 PM
Last Visit:
12/16/2008 11:40:39 PM
Status:
Offline
Moved you to Developement
 
     
   
Gender PostTime:12/16/2008 11:09:50 PM Point:0 | Floor# 3
Lv is 1
portrait
Level:
1
Professional point:
48
Experience:
8
Thread:
292
Post:
962
Total online time:
8M
Joined date:
4/28/2007 11:08:00 PM
Last Visit:
12/17/2008 12:44:40 AM
Status:
Offline
okay Christian.....

here is some code that moves an object.

it's attached to an event that is fired by clicking a link....
you can modify it as needed.

like I said....
a form is not really suited to this action....
but feel free to get imaginative (that's what DHTML is all about )

have fun

<html>
<head>
<title>move object</title>
<script>
var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1;

isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
if (withStyle == 1) {
if (isID) { return (document.getElementById(objectID).style) ; }
else {
if (isAll) { return (document.all[objectID].style); }
else {
if (isLayers) { return (document.layers[objectID]); }
};}
}
else {
if (isID) { return (document.getElementById(objectID)) ; }
else {
if (isAll) { return (document.all[objectID]); }
else {
if (isLayers) { return (document.layers[objectID]); }
};}
}
}
</script>
<script language="javascript">
function moveObjectTo(objectID,x,y) {
var domStyle = findDOM(objectID,1); domStyle.left = x; domStyle.top = y;
}
</script>
<style type="text/css">
#ob {
position: absolute;
top: 100px;
left: 30px;
font-size: 50px;
font-weight: bold;
color: #c00;
}
</style>
</head>

<body>
<a href="javascript:void('')" onClick="moveObjectTo('ob',500,350);">Click Me</a>
<div id="ob" >
Your Letter
</div>
</body>
</html>


NOTE: No space between "java" and "script" in this line:
<a href="javascript:void('')"
(the forum sticks that in there)
 
     
   
Gender PostTime:12/16/2008 11:41:59 PM Point:0 | Floor# 4
Lv is 1
portrait
Level:
1
Professional point:
32
Experience:
5
Thread:
287
Post:
980
Total online time:
5M
Joined date:
4/29/2007 12:12:00 AM
Last Visit:
12/16/2008 11:58:01 PM
Status:
Offline
okay Christian.....

here is some code that moves an object.

it's attached to an event that is fired by clicking a link....
you can modify it as needed.

like I said....
a form is not really suited to this action....
but feel free to get imaginative (that's what DHTML is all about )

have fun

<html>
<head>
<title>move object</title>
<script>
var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1;

isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
if (withStyle == 1) {
if (isID) { return (document.getElementById(objectID).style) ; }
else {
if (isAll) { return (document.all[objectID].style); }
else {
if (isLayers) { return (document.layers[objectID]); }
};}
}
else {
if (isID) { return (document.getElementById(objectID)) ; }
else {
if (isAll) { return (document.all[objectID]); }
else {
if (isLayers) { return (document.layers[objectID]); }
};}
}
}
</script>
<script language="javascript">
function moveObjectTo(objectID,x,y) {
var domStyle = findDOM(objectID,1); domStyle.left = x; domStyle.top = y;
}
</script>
<style type="text/css">
#ob {
position: absolute;
top: 100px;
left: 30px;
font-size: 50px;
font-weight: bold;
color: #c00;
}
</style>
</head>

<body>
<a href="javascript:void('')" onClick="moveObjectTo('ob',500,350);">Click Me</a>
<div id="ob" >
Your Letter
</div>
</body>
</html>


NOTE: No space between "java" and "script" in this line:
<a href="javascript:void('')"
(the forum sticks that in there)
 
     
   
Gender PostTime:12/16/2008 11:58:35 PM Point:0 | Floor# 5
Lv is 1
portrait
Level:
1
Professional point:
13
Experience:
9
Thread:
276
Post:
968
Total online time:
9M
Joined date:
4/28/2007 11:20:00 PM
Last Visit:
12/17/2008 12:36:54 AM
Status:
Offline
 
     
   
Gender PostTime:12/17/2008 12:06:08 AM Point:0 | Floor# 6
Lv is 1
portrait
Level:
1
Professional point:
62
Experience:
12
Thread:
287
Post:
938
Total online time:
12M
Joined date:
4/29/2007 2:35:00 AM
Last Visit:
12/17/2008 12:42:43 AM
Status:
Offline
Moved you to Developement
 
     
   
Gender PostTime:12/17/2008 12:51:39 AM Point:0 | Floor# 7
Lv is 1
portrait
Level:
1
Professional point:
46
Experience:
6
Thread:
265
Post:
966
Total online time:
6M
Joined date:
4/29/2007 12:00:00 AM
Last Visit:
12/17/2008 12:21:04 AM
Status:
Offline
 
     
   
Gender PostTime:12/17/2008 12:56:25 AM Point:0 | Floor# 8
Lv is 1
portrait
Level:
1
Professional point:
32
Experience:
5
Thread:
287
Post:
980
Total online time:
5M
Joined date:
4/29/2007 12:12:00 AM
Last Visit:
12/16/2008 11:58:01 PM
Status:
Offline
hi Christian....

what is the action of your submit???

normally, a form submits.... and an action occurs (like submitting to a different page).

I'm not going to say that you can't have the action also fire a different event (such as moving an object on the page)....
but if the form is submitting.... the objects on the form page won't matter much once the user submits the form.

I can provide you with some code..... but I don't think that it is applicable to be used with an onSubmit action.

Give me a sec to type it out.....
then you can apply it to whatever action you want to attach it to (although.... like I said.... a form submission does not seem to be the proper event for it)

give me a sec...........................
 
     
1

Sorry, you are not login, click here to login

 

About us | Advertise | Contact us | Partner | Bug Report|Suggesting box|Donation
Home | Forum | Affiliate program| Remote help | Setting | Search | Document | Help | Download|Message

 

Start new topicAdvanced search
Your location: Web designer -> Frontpage