i have the following code ..witch will change the background off my page from files on my computer..but it opens a new window to do it .
Can it be made to change the background on the same window ??
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script>
function display_image(i mage) {
myWindow = window.open("", "Preview", "toolbar=0,loca tion=0,director ies=0,status=0, menubar=0,scrol lbars=0,resizab le=1,copyhistor y=0,width=1024, height=768,targ et=_parent" );
myWindow.docume nt.open();
myWindow.docume nt.write("</HEAD><BODY BACKGROUND=" + image + "><center><br>< br><br>");
}
</script>
</HEAD>
<link href="style.css " rel="stylesheet " type="text/css" />
<center>
<BODY>
<table border="2" width="100%" height="100%">
<tr><td>
<form>
<p><input type="file" name="url"><br>
<input TYPE="button" VALUE="Wallpape r"
onClick="displa y_image("f ile:///"+document .forms[0].url.value)"> </p>
</form>
</td>
</tr>
</table>
</BODY>
</center>
</HTML>
3 1028 hsriat 1,654
Recognized Expert Top Contributor
Here is a good example which can help you.
thanks ..managed to make it open in the same page ,but now i have another problem..
is there a way to strech the images automaticly according to the table size ?/?
hsriat 1,654
Recognized Expert Top Contributor
thanks ..managed to make it open in the same page ,but now i have another problem..
is there a way to strech the images automaticly according to the table size ?/?
I think you may not do that with background image. But with the <img>, you can do that by changing its width attribute
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Paul |
last post by:
I link to a web site from an Excel spreadsheet. The page i link to is
getCookie.asp which sets a cookie then returns back some html which opens a
new window, to the same site but a different page (same folder).
The cookie is not received. Can someone explain why?
I worked around this by adding a cache-control header with a value of
no-cache. This fixes the problem. Unfortunately that causes another
problem with Internet Explorer...
|
by: Kai Grossjohann |
last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window.
That's fine, I don't need to do anything about it.
But Ctrl-N in IE appears to clone the current window. Is there a way
to intercept the key so that I can do stuff on the server side to make
the new window behave correctly?
(We have a JSP-based webapp which stores state in the session. Now if
two windows access (and modify!) the same session, then madness will
result....
|
by: Charles Packer |
last post by:
From one of the online Javascript tutorials, I learned how to
open a new window and set its size. I'm building a page that has
several small photographs, and I want to let the viewer examine
either a full size image or an image with supporting detail.
It's the same idea used on lots of Web sites that show thumbnails
where you click on one and the full-size image is displayed in a
new window. However, I have different-sized images that will...
|
by: Randell D. |
last post by:
HELP!
Its taken me ages - I'm a newbie and I've compiled bits of code that I've
read in this newsgroup over time to create one of my most intricate
functions to date...
Basically, the script gets called with a single arguement (full path to an
image). The image is supposed to be downloaded to the cache, and when
complete, a new window opened that is slightly larger insize then the images
dimensions... The new window will contain the...
|
by: Phillip Parr |
last post by:
Hello, I have a nice system where someone clicks on a picture to show the
full version. This pops up in a window.open box. It works great, the only
problem is that if the user clicks a second picture before closing the first
then the new picture loads into the original popup box which is often a
different size. How can i make them open in their own popup windows?
Thanks
| |
by: Altramagnus |
last post by:
I have 30 - 40 type of different window.
For each type I need about 20 instances of the window.
When I try to create them, I get "Error creating window handle"
My guess is there is a maximum number of window handle, because if I reduce
to about 2 instances of each window,
it can run. But not 20 instances of each window.
Does anyone know what the problem is? is it really because it exceeds the
maximum number of window handle?
|
by: MrFez |
last post by:
I have an webform from which I open a child window to display a calendar.
When a date is selected in the calendar window it attempts to set the value
of a textbox in the main (parent) window by using the window.opener property
to reference the textbox.
Everything works fine initially. However if the the main window does a
postback and the calendar is re-opened, its window.opener property will
always be null.
So: BEFORE main window...
|
by: David Hayes |
last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the
browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12
AM):
>
> >I want to maximize the browser window when I open a new window.
>
> function expand() {
> window.moveTo(0,0);
> window.resizeTo(screen.availWidth, screen.availHeight);
> }
|
by: D. Alvarado |
last post by:
Hello,
I am trying to open a window containing an image and I would like
the image to be flush against the window -- i.e. have no padding or
border. Can I make this happen with a single call to a window.open
function? I would prefer not to create a separate HTML page. So far
all I have is the basic
var cwin = window.open('images/KJV-THANKS.gif',
'Thanks', 'width=243,height=420,');
cwin.focus();
|
by: multicherry |
last post by:
Hi,
Having searched for a way to fetch a window object by name, all I came
across were answers along the line of...
"All you have to do is say windowObj = window.open("blah", "name");"
which isn't very useful if you want to fetch information from an
existing document in the window.
One solution I came up with was quite simple; open the "new" window,
giving you a reference to the object, then use window.history.back() to
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |