By jove! an answer to my dilemma perhaps?

R

Richard

http://www.codeave.com/javascript/image_click.html

With this guy's method of selecting an image, and displaying the results, I
do believe I can accomplish what I want now.

If my thinking is correct, I can just use a simple image swap to place the
output in the desired division?

Going one step farther, including a description with a mouse over before the
visitor clicks on the link.

Comments welcomed.
 
R

Richard

Richard said:
http://www.codeave.com/javascript/image_click.html

With this guy's method of selecting an image, and displaying the results, I
do believe I can accomplish what I want now.

If my thinking is correct, I can just use a simple image swap to place the
output in the desired division?

Going one step farther, including a description with a mouse over before the
visitor clicks on the link.

Comments welcomed.

Working out quite well actually.
It is a basic image swap with a twist.
However, in the coding i want to show the full size image rather than just
another thumbnail.

if(clicks==0){document.images['large'].src=image0.src;}

What's the proper syntax for adding +big to the src code?
that is, this code displays "images/pic1.jpg" but I want to display
"images/pic1big.jpg" instead.
 
M

Mick White

Richard said:
http://www.codeave.com/javascript/image_click.html

With this guy's method of selecting an image, and displaying the results, I
do believe I can accomplish what I want now.

If my thinking is correct, I can just use a simple image swap to place the
output in the desired division?

Going one step farther, including a description with a mouse over before the
visitor clicks on the link.

The code could be optimized:

<img... onclick="document.images['large'].src=this.src">

That replaces 50 lines of code...
Mick
 
R

Richard

Mick White said:
Richard said:
http://www.codeave.com/javascript/image_click.html

With this guy's method of selecting an image, and displaying the results, I
do believe I can accomplish what I want now.

If my thinking is correct, I can just use a simple image swap to place the
output in the desired division?

Going one step farther, including a description with a mouse over before the
visitor clicks on the link.

The code could be optimized:

<img... onclick="document.images['large'].src=this.src">

That replaces 50 lines of code...
Mick

When learning, one takes it one step at a time.
I plan on cleaning up the code later after it all comes together the way I
want.
I could also put the click checking lines into a loop which would eliminate
a lot of repetitive coding.
 
M

Mick White

Richard said:
Working out quite well actually.
It is a basic image swap with a twist.
However, in the coding i want to show the full size image rather than just
another thumbnail.

if(clicks==0){document.images['large'].src=image0.src;}

What's the proper syntax for adding +big to the src code?
that is, this code displays "images/pic1.jpg" but I want to display
"images/pic1big.jpg" instead.


function image_click(clicks){
document.images['large'].src="images/pic"+clicks+"big.jpg"
}
No need for : if(clicks==0) etc. Just build the src string using the
"clicks" parameter, as above.

Mick
 
H

Hywel Jenkins

Mick White said:
Richard said:
http://www.codeave.com/javascript/image_click.html

With this guy's method of selecting an image, and displaying the results, I
do believe I can accomplish what I want now.

If my thinking is correct, I can just use a simple image swap to place the
output in the desired division?

Going one step farther, including a description with a mouse over before the
visitor clicks on the link.

The code could be optimized:

<img... onclick="document.images['large'].src=this.src">

That replaces 50 lines of code...
Mick

When learning, one takes it one step at a time.

You're not learning though, are you, RtS? You're just borrowing code
from others far more talented that you.
 
R

Richard

Hywel Jenkins said:
Mick White said:
Richard wrote:

http://www.codeave.com/javascript/image_click.html

With this guy's method of selecting an image, and displaying the results, I
do believe I can accomplish what I want now.

If my thinking is correct, I can just use a simple image swap to
place
the
output in the desired division?

Going one step farther, including a description with a mouse over
before
the
visitor clicks on the link.


The code could be optimized:

<img... onclick="document.images['large'].src=this.src">

That replaces 50 lines of code...
Mick

When learning, one takes it one step at a time.

You're not learning though, are you, RtS? You're just borrowing code
from others far more talented that you.

Wellll duhhhhh. Don't we all?
"Borrowed" coding appears to be a fairly accepted on the web from what I've
seen so far.
Hell, for every code you write, I'll bet I can find 50 examples of the same
thing elsewhere.
And 40 of them will be copyrighted no less.
 
R

Richard

Mick White said:
Richard said:
Working out quite well actually.
It is a basic image swap with a twist.
However, in the coding i want to show the full size image rather than just
another thumbnail.

if(clicks==0){document.images['large'].src=image0.src;}

What's the proper syntax for adding +big to the src code?
that is, this code displays "images/pic1.jpg" but I want to display
"images/pic1big.jpg" instead.


function image_click(clicks){
document.images['large'].src="images/pic"+clicks+"big.jpg"
}
No need for : if(clicks==0) etc. Just build the src string using the
"clicks" parameter, as above.

Mick

Thanks mike. I'll put that to good use.
I beleive the guy was merely showing the simplicity rather than the extreme.
He could have put it all in loops to make it easier.
 
R

Randy Webb

Richard said:
Wellll duhhhhh. Don't we all?
"Borrowed" coding appears to be a fairly accepted on the web from what I've
seen so far.
Hell, for every code you write, I'll bet I can find 50 examples of the same
thing elsewhere.
And 40 of them will be copyrighted no less.

Thats easy enough to prove your assumption (which is incorrect).

Search the archives for "dynamically load JS Files" and then find me 50
examples of that code on the web, and 40 of them that are copyrighted.

Either back up your assinine assumptions or STFU
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top