Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Different image reload in the page when i click in the refresh(f5)...Not randomly
Old 07-23-2009, 08:26 AM Different image reload in the page when i click in the refresh(f5)...Not randomly
soumen_07's Avatar
Average Talker

Posts: 29
Name: Soumen paul
Trades: 0
hi,

Different image reload in the page when i click in the refresh(f5) also images will come in sequence... like img1 ,img2, img3... but not randomly...

Please help me.
soumen_07 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-23-2009, 09:24 AM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Try javascript or php
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 07-23-2009, 01:46 PM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
soumen_07's Avatar
Average Talker

Posts: 29
Name: Soumen paul
Trades: 0
hi,

Please give me the solution. it very Essential for me.

Soumen
soumen_07 is offline
Reply With Quote
View Public Profile
 
Old 07-24-2009, 07:02 AM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
soumen_07's Avatar
Average Talker

Posts: 29
Name: Soumen paul
Trades: 0
hi,

Different image reload in the page when i click in the refresh(f5) and also images will come in sequence... like img1 ,img2, img3... but not randomly...

Please give me the solution. it very Essential for me.

Regards

Soumen
__________________
ssp
soumen_07 is offline
Reply With Quote
View Public Profile
 
Old 07-24-2009, 07:13 AM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
In what code???????
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-24-2009, 09:10 AM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
MDwebdev85's Avatar
Extreme Talker

Posts: 215
Location: North Carolina
Trades: 0
http://lmgtfy.com/?q=javascript+image+rotator
MDwebdev85 is offline
Reply With Quote
View Public Profile Visit MDwebdev85's homepage!
 
Old 07-24-2009, 05:58 PM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.modtalk.co.uk/_site/code/.../rotate-image/

and if you want random images >>

http://www.modtalk.co.uk/_site/code/.../random-image/

I'll do a write up over the weekend
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-24-2009, 07:09 PM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
Skilled Talker

Posts: 54
Trades: 0
I would suggest using PHP because using Javascript for such a task is disturbingly ugly when viewing the source code.

Its the difference between--

<img src="randomImageLocation.ext">

-- and forty+ lines of Javascript (visible to the user).
KellyAX is offline
Reply With Quote
View Public Profile
 
Old 07-25-2009, 12:33 PM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And if you are hosting without any server side code available?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-27-2009, 01:29 AM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
soumen_07's Avatar
Average Talker

Posts: 29
Name: Soumen paul
Trades: 0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Change Images</title>
</head>

<body>
<script language="JavaScript">
<!--
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
//alert("VAL: " + ad);
if (ad==1) {
alt="PRIME definition"; banner="http://www.webmaster-talk.com/images/image1.jpg";
width="750";
height="500";
}
if (ad==2) {
alt="PRIME definition"; banner="http://www.webmaster-talk.com/images/image2.jpg";
width="750";
height="500";
}
if (ad==3) {
alt="PRIME definition"; banner="http://www.webmaster-talk.com/images/image3.jpg";
width="750"; height="500";
}
document.write('<center>');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('</center>');
// -->
</script>
</body>
</html>


this is the code... please have a look

images should be come in sequence...like img1 ,img2, img3....... img1, img2. img3... for every refresh ... but not randomly... and work in all browser...

thanking you

soumen
__________________
ssp

Last edited by soumen_07; 07-27-2009 at 01:37 AM..
soumen_07 is offline
Reply With Quote
View Public Profile
 
Old 07-27-2009, 05:50 AM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
and did you look at the code in the links I posted?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-28-2009, 02:42 AM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
soumen_07's Avatar
Average Talker

Posts: 29
Name: Soumen paul
Trades: 0
Thank you very much for your help.

Its now working... but i need one more requirement. Every page reload image should start from 1.jpg then it will work like the same.

Now it is working like the following..
1st reload start with 1.jpg
2nd reload start with 2.jpg
3rd reload start with 3.jpg

then again 1... 2... 3..

Thanking you

Soumen
__________________
ssp
soumen_07 is offline
Reply With Quote
View Public Profile
 
Old 07-28-2009, 03:05 AM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
SO...

Exactly the way that http://www.modtalk.co.uk/_site/code/.../rotate-image/ does?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-28-2009, 06:45 AM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
soumen_07's Avatar
Average Talker

Posts: 29
Name: Soumen paul
Trades: 0
no here i that problem...

if i use new browser every time then the problem has come. otherwise its working...

that means
open new browser paste the link... starting with 1

and again...
open new browser paste the link... starting with 0

and again...
open new browser paste the link... starting with 2

like that.

my requirement every time should start with 0.

thanking you

Soumen
__________________
ssp
soumen_07 is offline
Reply With Quote
View Public Profile
 
Old 07-28-2009, 07:03 AM Re: Different image reload in the page when i click in the refresh(f5)...Not randomly
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
that's because it sets a cookie to store the last used and the cookie expiry is 1 day. Change the expiry time to 0 (expire immediately) and it will only last for the browser session.
Or add in another JS function to clear the cookie or set the initial value to 0, use the window.onclose event to trigger this function.

The idea of writing code in forum posts is to give you a starting point from which you can adapt the code to suit your purpose. It is NOT a replacement for hiring a developer or paying a freelancer to write the exact code for you.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Different image reload in the page when i click in the refresh(f5)...Not randomly
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.49115 seconds with 12 queries