471,316 Members | 1,514 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

By jove! an answer to my dilemma perhaps?

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.

Jul 23 '05 #1
8 1083
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

Jul 23 '05 #2

"Richard" <An*******@127.001> wrote in message
news:cs********@news2.newsguy.com...
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.

Jul 23 '05 #3

"Mick White" <mw***********@rochester.rr.com> wrote in message
news:JN*********************@twister.nyroc.rr.com. ..
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.
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.
Jul 23 '05 #4
Richard wrote:

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
Jul 23 '05 #5
In article <cs********@news2.newsguy.com>, An*******@127.001 says...

"Mick White" <mw***********@rochester.rr.com> wrote in message
news:JN*********************@twister.nyroc.rr.com. ..
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.

--
Hywel http://kibo.org.uk/
I do not eat quiche.
Jul 23 '05 #6

"Mick White" <mw***********@rochester.rr.com> wrote in message
news:Zt*******************@twister.nyroc.rr.com...
Richard wrote:

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.
Jul 23 '05 #7

"Hywel Jenkins" <hy**********@hotmail.com> wrote in message
news:MP************************@news.individual.ne t...
In article <cs********@news2.newsguy.com>, An*******@127.001 says...

"Mick White" <mw***********@rochester.rr.com> wrote in message
news:JN*********************@twister.nyroc.rr.com. ..
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.
Jul 23 '05 #8
Richard wrote:
"Hywel Jenkins" <hy**********@hotmail.com> wrote in message
news:MP************************@news.individual.ne t...
In article <cs********@news2.newsguy.com>, An*******@127.001 says...
"Mick White" <mw***********@rochester.rr.com> wrote in message
news:JN*********************@twister.nyroc.rr.c om...

Richard wrote:
<--snip-->
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.


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
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Bruce W...1 | last post: by
reply views Thread by A. B., Khalid | last post: by
3 posts views Thread by Kevin Dahlhausen | last post: by
1 post views Thread by Fernando Libonati | last post: by
1 post views Thread by vincent delft | last post: by
137 posts views Thread by Philippe C. Martin | last post: by
3 posts views Thread by bearophileHUGS | last post: by
4 posts views Thread by homsan toft | last post: by

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.