473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

a button shows multiple times in one page

I have a javascript that displays couple of buttons, which are
directional (e.g., click button it goes to a particular page). I need
to have these buttons shows up multiple times in same page, each
represent a different direction but buttons themself are from the same
gif file. What's the most effecient way to do this? Any info would
be greatly appreciated.
Jul 23 '05 #1
1 1388
Hi Chinagirl;

"chinagirl" <ju*******@judyhhuang.com> wrote in message
news:e0**************************@posting.google.c om...
I have a javascript that displays couple of buttons, which are
directional (e.g., click button it goes to a particular page). I need
to have these buttons shows up multiple times in same page, each
represent a different direction but buttons themself are from the same
gif file. What's the most effecient way to do this? Any info would
be greatly appreciated.


I think the following would be pretty efficient (perhaps others will chime
in if I'm incorrect).

// use these statements to create a new image in javascript (this way the
image only needs
// to be downloaded from the web once)
myButton = new Image(76, 21);
myButton.src = "images/buttonImage2BeUsedMutipleTimes.gif";
// use these statements load the image on to the page (you will need, of
course, the proper
// <img> tags on the page -- and be sure to use the name property)
document [button_left].src = myButton.src;
document [button_right].src = myButton.src;
document [button_up].src = myButton.src;
document [button_down].src = myButton.src;

/* sample <img> tag form one of my HTML pages
<img src="images/contact_off.gif" alt="Contact Info -- How to contact
us."
border="0" width="76" height="17" name="contact">
*/

HTH.

Charles...

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.684 / Virus Database: 446 - Release Date: 5/13/04
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Carlo Marchesoni | last post by:
From an aspx page (A.aspx) I open another one (B.aspx - for table lookup). When the user selects an entry in B.aspx I would like to force a button's event in A.aspx to be fired. I guess the only...
3
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine,...
8
by: Shimon Sim | last post by:
Hi, Every time I write ASP.NET application I have the same problem - Back button on the browser is my enemy. I have to tell client avoid using "Back" button and if you use it make sure to refresh...
16
by: Barry Gilmore | last post by:
Is there a way to disable a button after it is clicked? I am trying to avoid having someone click on it twice while they wait for it to process. Thank you!
3
by: Remy | last post by:
Here is the situation: I have an ASP.NET 2.0 page with 2 panel. Each has a few textboxes and one DefaultButton. All textboxes have one or more Validator. Now everything works fine if I fill...
21
by: Ben | last post by:
Hello I have frames set up in an asp.net application and need one frame to refresh another. Seeing as events need to be registered at the time the page is sent from the server, I was wondering...
6
by: yk | last post by:
Hi, Is it a technique available in html/javascript in order to display same image many many times on a same page? Because of a large page loading I am looking for a way not to have same...
6
by: lucyh3h | last post by:
Hi, In one of my pages, I use javascript (AJAX) to populate one mulitple select field based on user's click event on another control. I noticed that when I navigate back to this page by clicking...
10
by: crazycooter | last post by:
I found an old thread on this (http://groups.google.com/group/alt.php/ browse_thread/thread/751edb9c723316c4/ea9bf92a9c6b807c?lnk=gst&q=mail() +duplicate&rnum=7#ea9bf92a9c6b807c), but there didnt...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
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...
0
marktang
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.