![]() ![]() |
| jyrkz |
Sep 12 2006, 05:08 PM
Post
#1
|
|
Group: Members Posts: 2 Joined: 12-September 06 Member No.: 119 |
hi all
im using dreamweaver 8 at left side i got "text" right side "image" here is what i cant do... if i press on "text" i want image on right side to swap with other image it should be easy but i cant handle it and is it possible to swap "table id" ? This post has been edited by jyrkz: Sep 12 2006, 05:09 PM |
| Christian J |
Sep 12 2006, 05:15 PM
Post
#2
|
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 4,776 Joined: 10-August 06 Member No.: 7 |
Hi!
QUOTE if i press on "text" i want image on right side to swap with other image This can't be done with only HTML, you must use e.g. javascript. Unless DW contains such a script you'll have to search the web for one, or write one yourself. QUOTE and is it possible to swap "table id" ? You mean, change the ID of a table? Yes that can be done with javascript too. |
| jyrkz |
Sep 12 2006, 05:17 PM
Post
#3
|
|
Group: Members Posts: 2 Joined: 12-September 06 Member No.: 119 |
could some1 gimme some code or smth
in table i got "text+image"(right side) so if i press on "text"(left side) i want it to swap to diffrent "text+image" (right side) This post has been edited by jyrkz: Sep 12 2006, 05:20 PM |
| Darin McGrew |
Sep 12 2006, 05:53 PM
Post
#4
|
|
WDG Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Root Admin Posts: 7,857 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
QUOTE if i press on "text" i want image on right side to swap with other image This can't be done with only HTML, you must use e.g. javascript. FWIW, here's an example that uses CSS (but no JavaScript).-------------------- Darin McGrew
WDG Member since 1998 |
| CodeKing |
Sep 12 2006, 07:42 PM
Post
#5
|
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 175 Joined: 12-September 06 Member No.: 118 |
QUOTE if i press on "text" i want image on right side to swap with other image function swapImage(ID,src) { document.getElementsById(ID).src = src; } <a href="java script: swapImage('myImage','http://www.mysite.com/image.gif');">Swap image!</a> QUOTE and is it possible to swap "table id" ? function swapTableId(oldID,newID) { document.getElementsById(oldID).id = newID; } <a href="java script: swapTableID('myTable','newTable');">Swap table ID!</a> (Try that. I'm not sure if it'll work.) CodeKing |
| Darin McGrew |
Sep 13 2006, 12:49 AM
Post
#6
|
|
WDG Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Root Admin Posts: 7,857 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Just a quick comment on the href="java script:..." links: It's better to use the onclick event handler, and to put a real URL in the href attribute.
-------------------- Darin McGrew
WDG Member since 1998 |
| Frederiek |
Sep 13 2006, 02:07 AM
Post
#7
|
|
Programming Fanatic ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 3,547 Joined: 23-August 06 From: Europe Member No.: 9 |
In addition to the link Darin gave: to swap an image AND text, then go see this CSS exemple from Eric Meyer.
-------------------- "The earth does not belong to us. We belong to the earth."
from Vue du ciel (in French) "Leave scepticism to others and take action" from HOME by Goodplanet An inconvenient truth by Al Gore |
| Christian J |
Sep 13 2006, 09:25 AM
Post
#8
|
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 4,776 Joined: 10-August 06 Member No.: 7 |
QUOTE if i press on "text" i want image on right side to swap with other image This can't be done with only HTML, you must use e.g. javascript. FWIW, here's an example that uses CSS (but no JavaScript).True, but that only works while the mouse hovers, not permanently like when you click. If that's an important distinction is another issue. |
![]() ![]() |
|
Lo-Fi Version | Time is now: 25th May 2013 - 08:18 PM |