|
I just moodified it now u can check
And let me know whether it's working or not
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|
|
try this
"tipId" is id of your div
and "fldid" is id of control with respect to which you want to show div
call showtip() and hidetip() where you require
function showTip(tipId,fldid)
{
var coords=getPosition(fldid)
var x=coords.left
var y=coords.top+3
var tipwin=document.getElementById(tipId)
tipwin.style.position="absolute"
tipwin.style.left=x+"px"
tipwin.style.top=y+"px"
tipwin.style.visibility="visible"
tipwin.style.display="block"
var tipcon=document.getElementById('_tipcon')
if(tipcon)
{
if (navigator.appName=="Netscape")
{
tipcon.style.position="absolute"
tipcon.style.left=(x+8)+"px"
tipcon.style.top=(y-9)+"px"
tipcon.style.visibility="visible"
tipcon.style.display="block"
}
else if ((navigator.appName).indexOf("Microsoft")!=-1)
{
tipcon.style.position="absolute"
tipcon.style.left=(x+8)+"px"
tipcon.style.top=(y-13)+"px"
tipcon.style.visibility="visible"
tipcon.style.display="block"
}
}
}
function hideTip(tipId)
{
var tipwin=document.getElementById(tipId)
tipwin.style.visibility="hidden"
tipwin.style.display="none"
var tipcon=document.getElementById('_tipcon')
if(tipcon)
{
tipcon.style.visibility="hidden"
tipcon.style.display="none"
}
}
function getPosition(id)
{
var elem=document.getElementById(id)
var pos={left ,top }
while(elem)
{
if(elem.style.position=='absolute')
break
pos.left+=elem.offsetLeft
pos.top+=elem.offsetTop+3
elem=elem.offsetParent
}
return pos
}
cheers sanjeev
|
|
|
|
|
Hello,
I tried your code but there is still problem due to the fact that I am using a centered design.
I tried to solve this but I don't know how.
When the div becomes visible its position is correct.
However, when I resize my browser window the div stays in same place and doesn't move with the image.
Here is a description of what I am trying to do:
1. I make all div's centered using "text-align: center" in body tag.
2. I use the "wrapper" div so I don't need to worry with centering the other divs.
In this code it would be easy to remove the wrapper div.
However, when the design gets more complex I prefer to use the wrapper.
3. I need to show "Tip" div when "Open" image is pressed.
4. I need to hide "Tip" div when "Close" image is pressed.
"Close" image is inside div "Tip".
5. I need "tip" div position to be relative to "Open" image.
Its position should be 40px right and 60px up from "Open" image position.
6. I neet "tip" div to be over the page contents.
7. The "tip" div should also move when visible and the page is being resized.
Basically, when the page is resized, the "Open" image will move.
So, the "tip" div, if visible, will keep up its position.
Anyway, is this possible?
Thank You Very Much,
Miguel
Here is my page code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
margin-botton: 10px;
padding: 0px;
text-align: center;
}
#wrapper {
clear: both;
margin: 0px auto;
padding: 0px;
text-align: left;
width: 780px;
}
#header, #content, #footer
{
clear: both;
}
#tip {
width: 200px;
}
.clearer
{
clear: both;
}
-->
</style>
</head>
<body>
<div id="wrapper">
<div id="header">Header</div>
<div id="content">
<p>Content</p>
<div id="tip">
<img id="close" src="Close.jpg" />
<p>Tip Text</p>
</div>
<img id="open" src="Open.jpg" />
</div>
<div id="content">Footer</div>
<div class="clearer">
</div>
</body>
</html>
|
|
|
|
|
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.
|
|
|
|