Refresh Image Button Needed (refreshes image only, not whole page) [fixed] |
Author: |
Message: |
prashker
Veteran Member
![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif)
Posts: 5108 Reputation: 104
– / / –
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)](images/smilies/msn_angel.gif) ?
This post was edited on 04-21-2007 at 08:55 PM by prashker.
|
|
04-21-2007 06:39 PM |
|
![](images/pixel.gif) |
MeEtc
Patchou's look-alike
![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif)
![Avatar](http://meetcweb.com/up/v.png)
In the Shadow Gallery once again
Posts: 2191 Reputation: 60
39 / / ![Canada Flag](images/flags/ca.png)
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: sharing.png]](http://www.meetcweb.com/files/sharing.png)
I cannot hear you. There is a banana in my ear.
|
|
04-21-2007 06:52 PM |
|
![](images/pixel.gif) |
Nathan
Veteran Member
![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif)
![Avatar](images/avatars/removed/dimensions.png)
Yeah, "large dimensions" ;)
Posts: 2978 Reputation: 76
– / / ![United Kingdom Flag](images/flags/gb.png)
Joined: Apr 2005
|
RE: Refresh Image Button Needed (refreshes image only, not whole page)
It is infact in the body tag: using a style.
|
|
04-21-2007 06:56 PM |
|
![](images/pixel.gif) |
MeEtc
Patchou's look-alike
![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif)
![Avatar](http://meetcweb.com/up/v.png)
In the Shadow Gallery once again
Posts: 2191 Reputation: 60
39 / / ![Canada Flag](images/flags/ca.png)
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: sharing.png]](http://www.meetcweb.com/files/sharing.png)
I cannot hear you. There is a banana in my ear.
|
|
04-21-2007 06:57 PM |
|
![](images/pixel.gif) |
Nathan
Veteran Member
![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif)
![Avatar](images/avatars/removed/dimensions.png)
Yeah, "large dimensions" ;)
Posts: 2978 Reputation: 76
– / / ![United Kingdom Flag](images/flags/gb.png)
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.
|
|
04-21-2007 07:03 PM |
|
![](images/pixel.gif) |
prashker
Veteran Member
![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif)
Posts: 5108 Reputation: 104
– / / –
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](images/smilies/msn_tongue.gif) .
When you click a button like "Refresh this Image" it refreshes the image without reloading the whole page ![:p](images/smilies/msn_tongue.gif) .
This post was edited on 04-21-2007 at 07:06 PM by prashker.
|
|
04-21-2007 07:05 PM |
|
![](images/pixel.gif) |
MeEtc
Patchou's look-alike
![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif)
![Avatar](http://meetcweb.com/up/v.png)
In the Shadow Gallery once again
Posts: 2191 Reputation: 60
39 / / ![Canada Flag](images/flags/ca.png)
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: sharing.png]](http://www.meetcweb.com/files/sharing.png)
I cannot hear you. There is a banana in my ear.
|
|
04-21-2007 07:05 PM |
|
![](images/pixel.gif) |
vaccination
Veteran Member
![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif)
![Avatar](images/avatars/removed/default.png)
Posts: 2511 Reputation: 43
33 / / –
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.
|
|
04-21-2007 07:06 PM |
|
![](images/pixel.gif) |
prashker
Veteran Member
![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif)
Posts: 5108 Reputation: 104
– / / –
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)](images/smilies/msn_up.gif) . 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](images/smilies/msn_tongue.gif) ?
This post was edited on 04-21-2007 at 07:12 PM by prashker.
|
|
04-21-2007 07:07 PM |
|
![](images/pixel.gif) |
andrewdodd13
Senior Member
![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif)
![Avatar](avatar.php?uid=42441-5770)
Oh so retro
Posts: 869 Reputation: 16
35 / / ![United Kingdom Flag](images/flags/gb.png)
Joined: Jan 2005
|
RE: Refresh Image Button Needed (refreshes image only, not whole page)
You could always use... *cough* frames *cough*. ![:P](images/smilies/msn_tongue.gif)
|
|
04-21-2007 07:37 PM |
|
![](images/pixel.gif) |
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|