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.

JavaScript Forum


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



Reply
Help on Arbitrary iframe Script
Old 02-23-2008, 07:34 AM Help on Arbitrary iframe Script
bigmacman's Avatar
Novice Talker

Posts: 7
Trades: 0
Hy

I have a script from dynamicdrive for random iframes , the url are taken from a list, and I want to modify this script to show the pages from the list in order.
Here is the script:
Code:
<html>
<head>
    <meta http-equiv="refresh" content="1";>
</head>

<body>

    
    <script language="JavaScript1.2">

//Random iframe content- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, and Terms Of use, visit http://dynamicdrive.com
//This credit MUST stay intact for use

var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1
var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1

//Specify IFRAME display attributes
var iframeprops='width=530 height=530 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"'

//Specify random URLs to display inside iframe
var randomcontent=new Array()
randomcontent[0]="http://www.webmaster-talk.com"
randomcontent[1]="http://www.dynamicdrive.com/"
randomcontent[2]="http://www.webmaster-talk.com/javascript-forum/"
randomcontent[3]="http://www.webmaster-talk.com/html-forum/"

//No need to edit after here
if (ie||dom)
document.write('<iframe id="dynstuff" src="" '+iframeprops+'></iframe>')

function random_iframe(){
if (ie||dom){
var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff
iframeobj.src=randomcontent[Math.floor(Math.random()*randomcontent.length)]
}
}

window.onload=random_iframe

</script>

    </body>
</html>
Can anyone help my?
__________________

bigmacman is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-23-2008, 10:56 AM Re: Help on Arbitrary iframe Script
Skilled Talker

Posts: 52
Name: Bruce
Trades: 0
What exactly are you wanting to happen? Are you wanting links to cycle through in a certain order while someone is on the page or are you wanting certain links to show up at a certain part of the day? Or something else?

That code displays one random link per onload, if you were wanting it to display links in a certain order to visitors each time they reload the page then you'd have to use cookies.

I'm not sure exactly what you're wanting, but I'm thinking it's going to require a completely different script instead of modifying that one.
SillyWilly is offline
Reply With Quote
View Public Profile
 
Old 02-23-2008, 02:21 PM Re: Help on Arbitrary iframe Script
bigmacman's Avatar
Novice Talker

Posts: 7
Trades: 0
I want the script to display the pages in order from the first one to the last one, it doesn't mater how, but cycling seems to be the best option.
__________________

bigmacman is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help on Arbitrary iframe Script
 

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.28579 seconds with 12 queries