473,396 Members | 1,785 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,396 software developers and data experts.

how to change images based on action.Even clicking changed images should do respective actions?

vj
how to change images based on action.
Even clicking changed images should do respective actions.
and while displaying only one image at a time sholud get displayed.
I am using three images for a single column of a table in Jsp.

Any clues.
Any link for any good javascript html jsp site where i can find some
good solution.

here swaping hiding which will work well.

no idea.

please guide me.

thanks
vijendra

Jan 12 '07 #1
3 3174
ASM
vj a écrit :
how to change images based on action.
Even clicking changed images should do respective actions.
and while displaying only one image at a time sholud get displayed.
I am using three images for a single column of a table in Jsp.

Any clues.
Any link for any good javascript html jsp site where i can find some
good solution.

Ideas to adapt to your table ...

Create a transparent image sized to 1 pixel (ie : 'empty.gif')

For each group of 3 images you create a new image with them
(paste them one by the other horizontaly)

Realize a styles sheet to fix your images :
- 'empty.gif' is to display in place of your originals images
- css to give them correct size(s)
- css to put in background the corresponding group of 3
- css (classes) to roll through the group :
change position of background

#myImages img { background: no-repeat center center }
#myImages img.pos1 { position: left center }
#myImages img.pos2 { position: right center }
#img1 { width: 120px; heiht: 78px; background-image:url(imgs/i_01.jpg);}
#img2 { width: 173px; heiht: 95px; background-image:url(imgs/i_02.jpg);}

Make a JS function to modify image :

function imager(id,clas) {
if(typeof(clas)=='undefined') clas = '';
document.getElementById(id).className=clas;
return false;
}

<a href="#" onclick="imager('img1','pos1');">test 1</a>
<a href="#" onclick="imager('img1','pos2');">test 2</a>
<a href="#" onclick="imager('img1','');">test 3</a>
<div id="myImages">
<img id="img1" src="empty.gif" alt="">
<img id="img2" src="empty.gif"
onmouseover="this.className='pos1';"
onmouseout="this.className='';"
onclick="this.className='pos2';"
alt="">
</div>
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 12 '07 #2
vj

this suggestion looks good.
But see my whole situation is this.

In broad way if i say i have multiple situations in mutiple tables
where i need such a logic to operate in for all tables.

lets say in first time load of page by default one image will be
displayed (one with sorted order for first column rest all non
sorted)Now after every click to any image respective sort should get
called.along with all images should get changed.Here with every
function one/two images will get effect at least.
As in first if i say sort by desc then this image will change rest all
will remain in unsort form.
when i move to other column and click on new image the previos will
convert to unsort and new one will convert to sort by ascending. rest
all will be in unsort form as it is.
Now it seems like same logic is required with two three conditions.
even for everyaction different parametrs has to be passed at differnt
situations.

i don't know how exactly this will fit but even though i will try
making it.

thanks
vijendra
On Jan 12, 4:06 pm, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
vj a écrit :
how to change images based on action.
Even clicking changed images should do respective actions.
and while displaying only one image at a time sholud get displayed.
I am using three images for a single column of a table in Jsp.
Any clues.
Any link for any good javascript html jsp site where i can find some
good solution.Ideas to adapt to your table ...

Create a transparent image sized to 1 pixel (ie : 'empty.gif')

For each group of 3 images you create a new image with them
(paste them one by the other horizontaly)

Realize a styles sheet to fix your images :
- 'empty.gif' is to display in place of your originals images
- css to give them correct size(s)
- css to put in background the corresponding group of 3
- css (classes) to roll through the group :
change position of background

#myImages img { background: no-repeat center center }
#myImages img.pos1 { position: left center }
#myImages img.pos2 { position: right center }
#img1 { width: 120px; heiht: 78px; background-image:url(imgs/i_01.jpg);}
#img2 { width: 173px; heiht: 95px; background-image:url(imgs/i_02.jpg);}

Make a JS function to modify image :

function imager(id,clas) {
if(typeof(clas)=='undefined') clas = '';
document.getElementById(id).className=clas;
return false;

}<a href="#" onclick="imager('img1','pos1');">test 1</a>
<a href="#" onclick="imager('img1','pos2');">test 2</a>
<a href="#" onclick="imager('img1','');">test 3</a>
<div id="myImages">
<img id="img1" src="empty.gif" alt="">
<img id="img2" src="empty.gif"
onmouseover="this.className='pos1';"
onmouseout="this.className='';"
onclick="this.className='pos2';"
alt="">
</div>

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 12 '07 #3
ASM
vj a écrit :
this suggestion looks good.
But see my whole situation is this.
what I understand of what you said (I'm lost in you images-columns)
is you want to sort a table.
http://kryogenix.org/code/browser/sorttable/

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 12 '07 #4

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

Similar topics

3
by: bigoxygen | last post by:
Hi. I have a list that is similar to this: -Evaluation +test +test -Students +test I would like to change the "-" bullet only, but I cannot. My
4
by: Richard Cornford | last post by:
For the last couple of months I have been trying to get the next round of updates to the FAQ underway and been being thwarted by a heavy workload (the project I am working on has to be finished an...
3
by: dataguy | last post by:
I can't find it anywhere in the manual, but I have a developer that wants to know if we can code a trigger to capture the data that has changed in a table only if certain columns have changed. It...
2
by: chrisse_2 | last post by:
Hi, I am working with images which vary depending on what record you are looking at. The images are linked into my database using vba code. I would like the user to be able to double click on...
41
by: Petr Jakes | last post by:
Hello, I am trying to study/understand OOP principles using Python. I have found following code http://tinyurl.com/a4zkn about FSM (finite state machine) on this list, which looks quite useful for...
0
by: dbuchanan | last post by:
Hello, The actions pane locks up after selecting a listbox. I have tried all kinds of things and have narrowed it down to this. If I click in the listbox the action pane locks up. Neither a...
61
by: phil-news-nospam | last post by:
Why does SVG need a different tag than other images? IMHO, SVG should be implemented as an image type just like any other image type, allowing it to work with <img> tags, and ... here is the...
11
by: Randy | last post by:
I have a MonthCalendar on one of my forms. I have disovered that the DateChanged event is triggered not only when the user clicks on a new date, but also if they click on the Previous or Next...
3
by: KennethLundin | last post by:
Hi, i'm developing a solution in VS9/CSharp. Now I'm constructing a deployment project for my appliation (thick, database driven, winforms, standard, good old type of application). During...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
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,...
0
jinu1996
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...
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.