|
Hi,
Are there javascript functions to find the cursor position of a mouse?
Also, are there javascript functions to find if the mouse cursor is within a listbox?
A C# code sample is shown below:
Listbox lb; //lb is a listbox
Point cpos = lb.PointToClient(Cursor.Position); //find coordinates of mouse
if(lb.ClientRectangle.Contains(cpos)) //if mouse cursor is within the listbox
Are there any javascript functions which can do the same as the above c# methods?
|
|
|
|
|
Ok I am trying desprately to give an image abs position depending on its parent's left.
code looks like this:
<div align="center">
<div align="center">
<img src="/images/Logo.gif" id="Logo" />
<span id="Header"><img src="/images/HeaderImg.gif" id="Header" /></span>
</div>
</div>
In my CSS I have something like:
#Logo
{
position:absolute;
top:19px;
left:expression(this.parentNode.style.left + 20 + 'px');
z-index:12;
/*border:solid 2px teal;*/
}
but its not working. I want my image to be 20px away from the DIV that it is in. What am I doing wrong here? can someone please help me with this. THanks in advance.
P.S. I have also tried parentNode.offsetLet + 20 + 'px' but it didnt work either and when I do:
left:expression(alert(this.parentNode.offsetLeft));
I get [0] I dont get it
|
|
|
|
|
It looks like you are trying to do this in the most difficult way possible. Do you really have to use absolute positioning? Why not simply put a margin on the image?
#Logo { margin-left: 20px; }
If the code that you show is all that you have in the body, the left edge of the parent element will however be at the left margin of the page. The div tag will use the full with of the page unless you tell it to do anything else.
---
b { font-weight: normal; }
|
|
|
|
|
Absolutely great, it works perfect you rock!! I spent over 5 hrs trying to find a freaking solution and it was that simple LOL
What I was trying to do was our graphic team designed the grapics for 800x600 but when we were seeing it at 1024x768 every thing was on the left and the client wanted it to be in the middle insted so I added a new div as a container and was trying to get the left of inner div for the positioning which was 0px initially; I didn't know that margin-left would do this for me and i won't have to get the parentNode.style.left property.
Thanks a lot.
|
|
|
|
|
Hi. I need to make a new browser page to open up once I click on a link, however, I do not want that browser page to contain the address bar or anything else[such as the return page, stop, refresh, home, favorites etc buttons to come up, just an empty browser page].
Keep in mind that I only have HTML in my sleeve, no JAVA, or anything else that could help me!!
I lose my job if I can't get this simple job done!!
|
|
|
|
|
Unfortunately, to do what you want to do, you have to use javacript in your HTML document (which is not JAVA). Search for "window.open" (DHTML) on this web site, http://www.google.com or your favorite searching web site.
-- modified at 10:50 Sunday 19th March, 2006
|
|
|
|
|
i have cache problem on the pages... i don't know the reason from me or from the server!
how can i tell the server to cache and not to cache?
i tried this code but nothing happend:
< ? header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 ? >
or
Militiaware
Faris Madi
-- modified at 10:35 Sunday 19th March, 2006
|
|
|
|
|
Hi...
I am trying to create crystal reports in ASP.Net.
When I run the report, I am getting huge white space on the left side of the web page.When I move viewer control's position to extreme left side of .aspx page I am able to avoid white space appearing on the web page.But I need to know is there any specific way to solve this problem? Can anyone tell me how can I change the back color of the chart?
Thanking u,
Sujatha
-- modified at 1:26 Saturday 18th March, 2006
|
|
|
|
|
Hi
I have a website (asp and SQL Server). It works fine before. but recent days, It will slow down (some time is fast and some time very slow) if I update some pages even the pages just have some static words changed!
I have no idea what cause this!!
Does anybody have some ideas?????
Thanks a lot!!
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
First, I would check your disk space. Sql Server files or IIS files may have grown very large. Also, check for viruses!
|
|
|
|
|
Did any one implemented ajax in web application?
sanjeev
|
|
|
|
|
|
|
|
It doesn't work because you are trying to mix client side script with server side script. This is not possible.
Consider these two rules:
1. The server side code and the client side code never exist in the same place.
2. The server side code and the client side code never exist at the same time.
Take a look at the source code of the page, and you'll see that what you have in the javascript function is the html code that the server code produced.
---
b { font-weight: normal; }
|
|
|
|
|
Firstly,Thanks for your guidance.I am still not clear about mixing ASP with Java in the code.
|
|
|
|
|
I started my first web project and created all the pages in MS Frontpage.
I wanted the pages to be secure (Query Strings) as the URL displays the actual dir path on the server.
Could you please guide me, how to change the existing HTML to an ASP.
I'll b gr8ful.
Thank's & Best Regards,
Shrikant
|
|
|
|
|
if you input some texts in a text box several times, later on, when the textbox is focus, it will show the previous input texts. How to disable/enable that feature?
Thank you guys!
Nice days.
Nam
|
|
|
|
|
IE->Tools->Internet Options->Content(Tab)->Autocomplete->Clear Forms
|
|
|
|
|
IE->Tools->Internet Options->press DeleteCookies button
It will delete cookies from temporary internet files
"I find that the harder I work, the more luck I seem to have."
|
|
|
|
|
|
thank you guys! I have done it.
|
|
|
|
|
Hello all
i have a table in my web page inside a form, the rows are added dynamically at runtime using javascript. (by the user)
The rows have edit boxes inside them which the user fills in.
When the user is done adding these rows they submit the form
Now, i am trying to validate the data (the sum of a column must equal or exceed 40)
using the following
the code is not the best but im bug fixing here
function validateRow(frm)
{
var tabl = document.getElementById('tblSample');
var l = tabl.rows.length;
var s = '';
var total= parseFloat(0.0);
for ( var i = 1; i < l; i++ )
{
var tr = tabl.rows[i];
var cll = tr.childNodes[1];
var ct = cll.innerHTML;
var cellAsString = ct.toString();
var index = cellAsString.lastIndexOf("value=");
index += 6 ;
var sub = cellAsString.substr(index, cellAsString.length - index-1);
var temp =parseFloat(sub);
total += temp;
var sr = total.toFixed() ;
}
if (total < 40.00)
{
var str = total.toString();
alert("The hours you submitted hours are not enough \nYour hours were:"+str);
return false;
}
return true;;
} ;
So the problem is that it works in IE, but not in Firepox errr FireFox.
in IE cellAsString holds text which includes the value of the edit box in the form "value=6" say
in FF the text holds the actual string used to create the table cell with the edit box inside
does anyone have any suggestions on how i can get the contents of the edit box using FF?
cheers
Bryce
---
To paraphrase Fred Dagg - the views expressed in this post are bloody good ones.
--
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
Our kids book :The Snot Goblin
-- modified at 22:16 Thursday 16th March, 2006
|
|
|
|
|
foudn an easier solution
function validate()
{
var id = "hours";
var index=1;
var total =0;
while (document.getElementById(id+index) != null)
{
var item = document.getElementById(id+index);
total+=item.value;
index++;
}
if (total < 40.00)
{
var str = parseFloat(total).toString();
alert("The hours you submitted hours are not enough \nYour hours were:"+str);
return false;
}
return true;
}
cheery
bryce
---
To paraphrase Fred Dagg - the views expressed in this post are bloody good ones.
--
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
Our kids book :The Snot Goblin
|
|
|
|
|
I would like to Start and Stop a flash movie from Javascript as well as change the file name in that object, anybody?
cheers
Al
|
|
|
|