Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > changing image without scripts?

Reply
Thread Tools

changing image without scripts?

 
 
Marc Waesche
Guest
Posts: n/a
 
      02-06-2004
Hello!

Is it possible to change out an image on a website with a mouse click
without using any scripts like javascript, css or else?

Best regards,
Marc


 
Reply With Quote
 
 
 
 
Chris Morris
Guest
Posts: n/a
 
      02-06-2004
"Marc Waesche" <(E-Mail Removed)> writes:
> Is it possible to change out an image on a website with a mouse click
> without using any scripts like javascript, css or else?


<a href="file_with_different_image.html">Change Image</a>

And CSS isn't a scripting language.

--
Chris
 
Reply With Quote
 
 
 
 
Matthias Gutfeldt
Guest
Posts: n/a
 
      02-06-2004
Chris Morris wrote:
> "Marc Waesche" <(E-Mail Removed)> writes:
>
>>Is it possible to change out an image on a website with a mouse click
>>without using any scripts like javascript, css or else?

>
>
> <a href="file_with_different_image.html">Change Image</a>
>
> And CSS isn't a scripting language.


Perhaps he was thinking of cross-site scripting


Matthias

 
Reply With Quote
 
Marc Waesche
Guest
Posts: n/a
 
      02-06-2004
Hi Chris!

You are right! CSS is no scripting language. Sorry. So a CSS solution would
be okay too.
Your idea is nice but I donīt want to refresh the website. The second image
must be loaded already but invisible. It should replace the first image by a
click on a link, button or else.

Best regards,
Marc


"Chris Morris" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> "Marc Waesche" <(E-Mail Removed)> writes:
> > Is it possible to change out an image on a website with a mouse click
> > without using any scripts like javascript, css or else?

>
> <a href="file_with_different_image.html">Change Image</a>
>
> And CSS isn't a scripting language.
>
> --
> Chris



 
Reply With Quote
 
Paul Furman
Guest
Posts: n/a
 
      02-06-2004
You could do it with frames or load an otherwise identical page.

Marc Waesche wrote:

> Hello!
>
> Is it possible to change out an image on a website with a mouse click
> without using any scripts like javascript, css or else?
>
> Best regards,
> Marc
>
>


 
Reply With Quote
 
Chris Morris
Guest
Posts: n/a
 
      02-06-2004
"Marc Waesche" <(E-Mail Removed)> writes:
> You are right! CSS is no scripting language. Sorry. So a CSS solution would
> be okay too.
> Your idea is nice but I donīt want to refresh the website. The second image
> must be loaded already but invisible. It should replace the first image by a
> click on a link, button or else.


Don't think that's possible without scripting of some sort. Certainly
not if you want the second image to stay there after the click ends.

If you just want the image to change when clicked on, then
http://www.dur.ac.uk/c.i.morris/imagechange.html
or
http://www.dur.ac.uk/c.i.morris/imagechange2.html
though I can't see many practical uses for this.

(Only tested in Mozilla - if it doesn't work in anything else I won't
be surprised. Especially the second one.)

If it's essential that the second image be displayed, then even CSS is
a risky solution, and <a href="page_of_other_image">...</a> is
probably the best solution.

--
Chris
 
Reply With Quote
 
Marc Waesche
Guest
Posts: n/a
 
      02-06-2004
Hi Paul!

Sounds cool! How would that work with frames? I know of cause what frames
are and how they work but do you have a code or a website where I could
check that?

Best regards,
Marc


P.S.: This is a cool newsgroup! So many nice answers in so short time!




"Paul Furman" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> You could do it with frames or load an otherwise identical page.
>
> Marc Waesche wrote:
>
> > Hello!
> >
> > Is it possible to change out an image on a website with a mouse click
> > without using any scripts like javascript, css or else?
> >
> > Best regards,
> > Marc
> >
> >

>



 
Reply With Quote
 
Marc Waesche
Guest
Posts: n/a
 
      02-06-2004
Hi Chris!

Thank you, I will check that out today.
My idea was that both images are in the website after each other. But the
size of the second is set to 0x0 pixels. Then, if the user click on a
(css-)link the first imageīs size is set to 0x0 and the size of the second
is enlarged to the full size. For the user it looks like a real image
changing.

By the way: I do not want to use scripts because it is not really for a
website. The code should be included into html mails. And some mail clients
donīt like scripts as you know for sure.

Best regards,
Marc



"Chris Morris" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> "Marc Waesche" <(E-Mail Removed)> writes:
> > You are right! CSS is no scripting language. Sorry. So a CSS solution

would
> > be okay too.
> > Your idea is nice but I donīt want to refresh the website. The second

image
> > must be loaded already but invisible. It should replace the first image

by a
> > click on a link, button or else.

>
> Don't think that's possible without scripting of some sort. Certainly
> not if you want the second image to stay there after the click ends.
>
> If you just want the image to change when clicked on, then
> http://www.dur.ac.uk/c.i.morris/imagechange.html
> or
> http://www.dur.ac.uk/c.i.morris/imagechange2.html
> though I can't see many practical uses for this.
>
> (Only tested in Mozilla - if it doesn't work in anything else I won't
> be surprised. Especially the second one.)
>
> If it's essential that the second image be displayed, then even CSS is
> a risky solution, and <a href="page_of_other_image">...</a> is
> probably the best solution.
>
> --
> Chris



 
Reply With Quote
 
Chris Morris
Guest
Posts: n/a
 
      02-06-2004
"Marc Waesche" <(E-Mail Removed)> writes:
> Sounds cool! How would that work with frames? I know of cause what frames
> are and how they work but do you have a code or a website where I could
> check that?


Try to avoid using frames for this.
http://www.html-faq.com/htmlframes/?framesareevil

--
Chris
 
Reply With Quote
 
Chris Morris
Guest
Posts: n/a
 
      02-06-2004
"Marc Waesche" <(E-Mail Removed)> writes:
> By the way: I do not want to use scripts because it is not really for a
> website. The code should be included into html mails. And some mail clients
> donīt like scripts as you know for sure.


Many mail clients don't like HTML or CSS either (mine copes with HTML
[1] but not CSS).

[1] Since well over 99% of the HTML mail I get is spam, it gets
filtered into a folder, and then usually deleted unread. I know I'm
not the only person to take this approach.

--
Chris
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing image without javascript mistral Javascript 14 03-04-2008 07:41 PM
Changing style of the numbers in a CSS <ol> without changing the style of the <li> Aaron Beall HTML 2 09-14-2007 08:07 PM
I want an image in a tablecell to be scaled to fit the cell without distorting the image active ASP .Net 15 06-27-2007 01:31 PM
changing without deteriorating original image Louise Digital Photography 10 04-03-2005 04:50 PM
changing file extension without changing filename jamy Computer Support 4 03-04-2005 01:03 AM



Advertisments