What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Refresh Image Button Needed (refreshes image only, not whole page) [fixed]

Pages: (2): « First [ 1 ] 2 » Last »
Refresh Image Button Needed (refreshes image only, not whole page) [fixed]
Author: Message:
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. Refresh Image Button Needed (refreshes image only, not whole page) [fixed]
Right now I have code that when you refresh the page it changes the image automatically that is displayed.

Thing is I dont really like that as it restarts the music playing in the backround.

So,

How would I create a button, that when you click it, it automatically reloads the image without refreshing the whole page, just the image part of it.

quote:
Nathan says:
it will probs use a cookie to track that they've enabled this, he also thinks you will have to use ajax.

Help (a)?

This post was edited on 04-21-2007 at 08:55 PM by prashker.
04-21-2007 06:39 PM
Profile PM Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: Refresh Image Button Needed (refreshes image only, not whole page)
if the image is an <img> tag, something like this might work:

code:
<input onclick="getimage()">

<script>
function getimage() {
   document.getElementById(picture id name).src = 'path to random image generator php file'
}
</script>


If its a css background image, use something like this:
code:
<script>
function getimage() {
   document.getElementById(picture id name).className = 'path to random image php file'
}
</script>


<script>
function getimage() {
   document.body.style.backgroundImage = 'url(path to random image php file)'
}
</script>



This post was edited on 04-21-2007 at 07:11 PM by MeEtc.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
04-21-2007 06:52 PM
Profile PM Web Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: Refresh Image Button Needed (refreshes image only, not whole page)
It is infact in the body tag: using a style.

Touch Innovation - touch friendly programs/applications for the windows mobile!


04-21-2007 06:56 PM
Profile E-Mail PM Web Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: Refresh Image Button Needed (refreshes image only, not whole page)
body? ok, ill edit the script

EDIT: no, that doesn't quite work yet

This post was edited on 04-21-2007 at 07:04 PM by MeEtc.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
04-21-2007 06:57 PM
Profile PM Web Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: Refresh Image Button Needed (refreshes image only, not whole page)
ah, yyou dont get sonicsam, he wants it to automatically update like a slideshow.
Touch Innovation - touch friendly programs/applications for the windows mobile!


04-21-2007 07:03 PM
Profile E-Mail PM Web Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. RE: Refresh Image Button Needed (refreshes image only, not whole page)
quote:
Originally posted by Nathan
ah, yyou dont get sonicsam, he wants it to automatically update like a slideshow.

Ok let me say it again :p.

When you click a button like "Refresh this Image" it refreshes the image without reloading the whole page :p.


This post was edited on 04-21-2007 at 07:06 PM by prashker.
04-21-2007 07:05 PM
Profile PM Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: Refresh Image Button Needed (refreshes image only, not whole page)
no, he says:
quote:
Originally posted by SonicSam
How would I create a button, that when you click it, it automatically reloads the image

if you want a slideshow, all you need to do is add the getimage() to the body onload and add a timer

This post was edited on 04-21-2007 at 07:06 PM by MeEtc.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
04-21-2007 07:05 PM
Profile PM Web Find Quote Report
vaccination
Veteran Member
*****

Avatar

Posts: 2513
Reputation: 43
32 / Male / –
Joined: Apr 2005
RE: Refresh Image Button Needed (refreshes image only, not whole page)
=s

He just wants a button that when you click reloads the php file - well that's my understanding anyway.
[Image: jumbled.png]
04-21-2007 07:06 PM
Profile PM Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. RE: Refresh Image Button Needed (refreshes image only, not whole page)
quote:
Originally posted by MeEtc

if you want a slideshow, all you need to do is add the getimage() to the body onload and add a timer

Nononono.

quote:
Originally posted by vaccination
=s

He just wants a button that when you click reloads the php file - well that's my understanding anyway.

(y). Basically.



So let me explain it 1 more time.

http://jesuswasajew.info/

See it plays music and shows a random image?

When you refresh the page, the image changes, but the music restarts, because the whole page was refreshed.

I want a button, that when you click it, changes ONLY the image, and does not refresh the whole page.

Ok :p?

This post was edited on 04-21-2007 at 07:12 PM by prashker.
04-21-2007 07:07 PM
Profile PM Find Quote Report
andrewdodd13
Senior Member
****

Avatar
Oh so retro

Posts: 870
Reputation: 16
34 / Male / Flag
Joined: Jan 2005
RE: Refresh Image Button Needed (refreshes image only, not whole page)
You could always use... *cough* frames *cough*. :P
[Image: AndrewsStyle.png]
04-21-2007 07:37 PM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On