I'd like to have a link that opens up in a pop up window, but while the window is open, I want to page that linked to it to be greyed out.
I found a script that would grey out the page but that was deigned to be toggled by a button so I could grey out the page and open the popup but when I closed the popup I couldn't get the page back.
I tried using a DHTML lightbox that greys out the page but I can only load images and not exteral pages in it.
Is there a way I can do this? I'm using php but to do this I would like to use JavaScript.
22 5730
Did u mean a transparent-black layer?
You can do this using CSS, and close the layer using JS
Yes, that right. Can I close the layer by closing the popup window?
Yes, of course, just set the obj.className = 'something';
I'm not sure I understand. You couldn't give me some sample code please?
First, did u mean this effect?
There can also a full page layer
I want to page to look like a disabled form element.
Also note, the element(form) behind the black background is disabled!
I found this script to grey out the background. -
function opacity(id, opacStart, opacEnd, millisec)
-
{
-
//speed for each frame
-
var speed = Math.round(millisec / 100);
-
var timer = 0;
-
-
//determine the direction for the blending, if start and end are the same nothing happens
-
if(opacStart > opacEnd)
-
{
-
for(i = opacStart; i >= opacEnd; i--)
-
{
-
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
-
timer++;
-
}
-
//make 'remove' button an 'undo' button
-
add_restore = id+'_remove';
-
restore = document.getElementById(add_restore);
-
restore.innerHTML = "undo";
-
restore.onClick="";
-
restore.onClick="opacity('t1',20,100,500)";
-
}
-
else if(opacStart < opacEnd)
-
{
-
for(i = opacStart; i <= opacEnd; i++)
-
{
-
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
-
timer++;
-
}
-
//make 'undo' button return to 'remove' button
-
add_restore = id+'_remove';
-
restore = document.getElementById(add_restore);
-
restore.innerHTML = "remove";
-
restore.onClick="";
-
restore.onClick="opacity('t1',100,20,500)";
-
}
-
}
-
//change the opacity for different browsers
-
function changeOpac(opacity, id)
-
{
-
var object = document.getElementById(id).style;
-
object.opacity = (opacity / 100);
-
object.MozOpacity = (opacity / 100);
-
object.KhtmlOpacity = (opacity / 100);
-
object.filter = "alpha(opacity=" + opacity + ")";
-
}
-
It has the greyed out effect I want but I need to be able to set it back when I close the popup rather than using a button as is done here.
Can I use an onclose event that will activate in a different browser?
if you are trying to load an html page which is not outside your domain you can use thickbox here is an example you see here and click onthe link name View Property Detail in front of any of the properties displayed
regards,
Omer Aslam
Thanks, I'll give it a go. By the way, is there a way to force a page to refresh?
obviously you can , in javascript you are asking i think
When I refresh by clicking on the refresh button or pressing F5 the page refreshes and then takes you to where you were before. The
function, take me back to the top of the page and leaves me there. Is they any way round that?
Another question, if you've put something on the onunload, I need it to happen is the user closes the window. Can I overide that, if they do something else?
i am not sure about it but try using -
location.replace(window.location.href);
-
and could not get the last post what are you trying to say
regards,
Omer Aslam
I'll try your suggestion. Don't worry about the last post.
if you were using the <a> links as like
<a href="#panel1">Panel 1</a>
then it would work i think that is you were looking for
Regards,
Omer Aslam
That's possibly the easiest thing to do; from the way my site operates. I'll give that one a try first.
Thanks.
yeah sure
Regards,
Omer Aslam
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Peter Foti |
last post by:
I have seen lots of examples where some HTML text is replaced with a
background image using CSS. For example, replacing the text of an <h1> with
a graphical logo, like so:
CSS:
h1 span {...
|
by: Penna Elabi |
last post by:
How do I create a style sheet with black background and white text?
|
by: Efkas |
last post by:
My application have some level :
1. MyButton class with Label inheritance
2. MyComponent as User Control loading and positionning some of
MyButtons
3. MyApp loading and positionning MyComponent
...
|
by: A.M |
last post by:
Hi,
Even I specifically mentioned "white" as background color of all
ASP:TextBoxes of my form, Some of them come up with yellow background.
I guess it should be kind of ASP.NET behaviour, but...
|
by: Juan Romero |
last post by:
Hey guys,
Does anyoone know how to make a control with transparent background?
This is what I have so far and it doesn't work:
Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)...
|
by: benfly08 |
last post by:
Hi, guys.
I have a program to draw bar/pie chart based on the data i hard coded in it. However, my image comes with "BLACK" background color. I don't know how to fix this. The code snippet is...
|
by: Niu Kun |
last post by:
Dear all,
I'm trying to draw many overlapped PNG files with transparent background
in imagebox control.
But the transparent background in this control is rendered as the main
control's...
|
by: nicky77 |
last post by:
Hi, I've created a nav bar using a background image for rollover effects. Everything works as I had hoped, however, for some reason it seems that an area of whitespace (the same size of the...
|
by: deshg |
last post by:
Hey everyone how are you all doing?
I am trying to use the imagerotate GD function to place an image on top of another image at an angle. Obviously when it rotates an image it creates a...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |