Results 1 to 3 of 3

Thread: Random Iframe Content w/ clickable content

  1. #1
    Join Date
    May 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Random Iframe Content w/ clickable content

    1) Script Title: Random Iframe Content

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ndomiframe.htm

    3) Describe problem:

    I used this script and would like to make my random content (images) linkable. Script is below and help is much appreciated. Thanks!

    <table cellpadding=0 cellspacing=0 width="100%" bgcolor=#fed500 style="border-top:1px groove #fed500"><td width=100% height="22px" class=whitefont align=center><b>Chick of the Day</b></td></table>
    <div align=center style="margin-top:5px;"><table width=146px height=220px><td width=100% align=center valign=center><a href="#" style="display:block;width:100%;height:100%;text-decoration:none;">
    <script language="JavaScript1.2">

    //Random iframe content- &#169; 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=146 height=220 bgcolor=#003366 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"'
    var openup='<a href="#">'
    var closeup='</a>'

    //Specify random URLs to display inside iframe
    var randomcontent=new Array()
    randomcontent[0]="http://www.virtualbluelot.com/Images/cod/1chick.jpg"
    randomcontent[1]="http://www.virtualbluelot.com/Images/cod/2chick.jpg"
    randomcontent[2]="http://www.virtualbluelot.com/Images/cod/3chick.jpg"
    randomcontent[3]="http://www.virtualbluelot.com/Images/cod/4chick.jpg"
    randomcontent[4]="http://www.virtualbluelot.com/Images/cod/5chick.jpg"
    randomcontent[5]="http://www.virtualbluelot.com/Images/cod/6chick.jpg"
    randomcontent[6]="http://www.virtualbluelot.com/Images/cod/7chick.jpg"
    randomcontent[7]="http://www.virtualbluelot.com/Images/cod/8chick.jpg"
    randomcontent[8]="http://www.virtualbluelot.com/Images/cod/9chick.jpg"


    //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>
    </a></td></table></div>

  2. #2
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    that shouldn't work...You are supposed to set the iframe to point to an html page.Not an image.

  3. #3
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    What you'll need to do:

    Put the images into html files, or any type of file, really; php, asp, etc.

    Link them within that file.

    Then change the url's to those files.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •