The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> swap image help :)
jyrkz
post Sep 12 2006, 05:08 PM
Post #1





Group: Members
Posts: 2
Joined: 12-September 06
Member No.: 119



hi all biggrin.gif im new here.. tongue.gif

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 smile.gif
it should be easy but i cant handle it blush.gif

and is it possible to swap "table id" ?tongue.gif

This post has been edited by jyrkz: Sep 12 2006, 05:09 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 12 2006, 05:15 PM
Post #2


.
********

Group: WDG Moderators
Posts: 5,922
Joined: 10-August 06
Member No.: 7



Hi! smile.gif

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.


--------------------
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jyrkz
post 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 smile.gif plsss biggrin.gif tongue.gif

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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Sep 12 2006, 05:53 PM
Post #4


WDG Member
********

Group: Root Admin
Posts: 7,998
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
QUOTE(Christian J @ Sep 12 2006, 03:15 PM) *
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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CodeKing
post 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

dry.gif sad.gif smile.gif biggrin.gif tongue.gif angry.gif mad.gif blink.gif blush.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Sep 13 2006, 12:49 AM
Post #6


WDG Member
********

Group: Root Admin
Posts: 7,998
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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Sep 13 2006, 02:07 AM
Post #7


Programming Fanatic
********

Group: Members
Posts: 4,278
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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 13 2006, 09:25 AM
Post #8


.
********

Group: WDG Moderators
Posts: 5,922
Joined: 10-August 06
Member No.: 7



QUOTE(Darin McGrew @ Sep 13 2006, 12:53 AM) *

QUOTE
if i press on "text" i want image on right side to swap with other image
QUOTE(Christian J @ Sep 12 2006, 03:15 PM) *
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.


--------------------
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th July 2014 - 08:10 AM