Another random image/javascript question

So I'm trying to find the easiest way to randomly select 4 images (out of range of 8 images) and present them on a page. No motion or transitions needed - just a way that every time someone visits the page a random selection of 4 of the 8 images are shown. My current HTML looks something like this:
<div id="slider">
            <ul id="randomSlide">
            <!-- 1 -->
                 <li>
                    <a href="path/to/someotherpage.html"><img alt="alt text" src="img/1.jpg"/></a>
                 </li>
          </ul>
</div>
So any suggestions on a good way to solve this problem? Any jQuery plugins? Tips?

I have not tested this on a live server, but this works perfectly locally. Put the following script immediately before the closing </body> tag on the page:
<script>
var images =  [], list = document.getElementById('randomSlide'),
    elems = list.getElementsByTagName('li');
images[0] = {src: 'lasvegas1.jpg', url: 'lasvegas.html'};
images[1] = {src: 'lasvegas2.jpg', url: 'lasvegas.html'};
images[2] = {src: 'longbeach.jpg', url: 'longbeach.html'},
images[3] = {src: 'longbeach2.jpg', url: 'longbeach.html'};
images[4] = {src: 'losangeles1.jpg', url: 'losangeles.html'};
images[5] = {src: 'losangeles2.jpg', url: 'losangeles.html'};
images[6] = {src: 'sanfrancisco1.jpg', url: 'sanfrancisco.html'};
images[7] = {src: 'sanfrancisco2.jpg', url: 'sanfrancisco.html'};
images.sort(function() { return 0.5 - Math.random()});
for (var i = 0; i < 4; i++) {
    elems[i].getElementsByTagName('a')[0].href = images[i].url;
    elems[i].getElementsByTagName('img')[0].src = 'images/' + images[i].src;
</script>
Obviously, you need to change the values of src and url in each array element.
What this does is create an array of objects containing the image name and its associated url. The array is then sorted randomly, and a loop that runs four times is used to populate the "randomSlide" unordered list, replacing the href and src attributes. I have assumed the images are in a folder called "images". If not, change the value of 'images/' in the loop at the end of the script.
When I tested this locally, I used # for the default href and an empty string for src in each <img> tag. Since some people might have JavaScript disabled, it might be better to use actual values. However, this might result in the images changing after the page loads. The problem is that you can't access the unordered list until it has loaded into the DOM. The alternative would be to sort the array and preload the images, but this will slow down the display of the whole page.
A server-side solution would be much more efficient.

Similar Messages

  • Another random image: empty frames

    Hi,
    trying to create a Web page, according to the recommendations of the previous threads.
    http://www.goldschmiede-blumberg.de/AdobTest/random/randomLink.php
    When renewing the page (F5) often enough, one blank frame appears, their image names are changing, however.
    Please help me to eliminate this mistake.
    Hans-G.

    Hi,
    with this correction in the sense of your advice:
           <a href="#"> <img alt="LinkGrafik08-300.jpg" src="images/LinkGrafik08-300.jpg"/> </ a>
    I think now it's all ok. I ignored that all images must be named (although all images had been uploaded). Thanks so much, especially for your prompt, fast and professional response.
    Hans-G.

  • Pull random images from iPhoto library folders

    I'm trying to come up with a script to pull random images from my iPhoto library and copy them to another folder that I can then use with another program (GeekTool) to display them on my desktop.
    What I'd like to be able to do is pull 30-50 of these images at a time. I can use GeekTool to call the script at a given interval (eg. every half hour) and have a completely different set of images everytime the script is run.
    I'm a complete obliviot when it comes to applescripting, so I'm at the mercy of the experts. I've managed to find a couple of scripts that can do something similar with the screensaver, but I'm unable to figure out the script enough to make it do what I need.
    Any help would be much appreciated. Thanks.
    brad

    You should post your question on the iPhoto forum.
    http://discussions.apple.com/category.jspa?categoryID=143
    Make sure you post your question in the appropriate iPhoto forum based on which version of iPhoto you have (4, 5 or 6).

  • Choose random image script

    I'm creating a small movie with a set of random images that all appear in the same spot (no horizontal or vertical movement). I want each image to appear onscreen for two seconds, then be replaced by another randomly-chosen image. There are 17 images in the set. Here is the script I'm using:
    on enterFrame
      channel=random(17)
      _movie.delay(2*60)
    on exitFrame
      go to the Frame
    end
    This script works well. However, because the population is small - only 17 - what happens when I run the script is that a little too often it randomly chooses the same image once, twice, sometimes up to five times in a row, which gives the effect that the movie is either stuck or not working properly. I would like to find out how to modify the script so that on exitFrame it chooses randomly any of the other 16 images but not the current image. At first I thought if the script read random(16) or random(17-1) that might work, but it doesn't.
    Any thoughts would be welcome.
    Dallas

    Hi Sean,
    This randomizing project of mine is becoming more complex than I first realized and I now have another question that I hope you might be able to help me with.
    The project breaks down into class, category, group and member. There are 9 classes (and perhaps a possibility in the future that further classes could be added). The structure and naming convention within each class is identical down to the member level. For example, Cat. 1 of Class 2 and Cat 1 of Class 7 both have the same names. Group 3 of Cat. 1 of Class 2 and Group 3 of Cat 1 of Class 6 both have the same names. However, the members of these groups do not have the same names.
    In each class there are 4 categories, each with a different name. Each category contains a number of groups (each group has a different name). Each group contains a number of members. Each member in categories 1 and 2 is a bitmap image. The total number of bitmap members in the project is 21.
    To give a fictionalized example (this project is not about clothing, but I'm using it as an example):
    Class 1 = shirts
    Class 2 = hats
    Class 3 = pants
    Class 4 = socks
    Class 5 = shoes
    etc.
    Category 1 = British
    Category 2 = Japanese
    Category 3 = Turkish
    Category 4 = Brazilian
    Group 1 = Cotton
    Group 2 = Synthetic
    Group 3 = Speed
    Group 4 = Sound
    and so forth.
    In Class 1 (shirts) there are British, Japanese, Turkish and Brazilian shirts and these could be made of either cotton or synthetic. In addition, there are a variety of speeds and sounds from which to choose when displaying the shirts.
    In my project:
    Cat. 1 has 7 groups and each group varies in the number of members with either 7, 14 or 21 (but no other alternative to these numbers).
    Cat. 2 has 13 groups and each group has 7 members.
    Cat. 3 does not randomize images but lets me choose any one of 12 different speeds for randomization in half-second increments.
    Cat. 4 does not randomize images but lets me choose any one of 6 different sounds. Whenever the randomized image changes, this triggers the sound. The sound is not randomized but is consistent once the choice for what KIND of sound has been made. In short: tick, tick,tick, or tock, tock, tock but not tick, tock. It is possible that in the future more sounds could be added.
    Navigation should allow me to start with any of the four categories. For randomization to work, I must choose within either Cat. 1 or Cat. 2 (but not both) and I must make a choice of some sort within Cat. 3 (speed of randomization) while Cat. 4 is entirely optional (sound on or off, but not required to be on and, if it's to be on then choice for which kind of sound).
    There are also an additional two buttons for sound on or off than run the length of the score within any class, meaning that while randomization is occuring anywhere within a class, I can choose to turn the sound on if it's currently off or off if it's currently on. Turning it on while randomization is taking place will also probably require a choice of which kind of sound (meaning a floating window I suppose) so as not to exit the frame where randomization is taking place.
    Now for my question: should I create one massive behaviour script for all classes that includes a series of nested if/else statements for each category, group and member, or should I create 4 large behavior scripts, one for each category with if/else instructions for its groups and members, or should I script at the group level, which will result in 180 separate behaviour scripts for image randomization plus additional scripts for speed and sound?
    Further, I understand how to apply at the group level the script you gave me earlier (and it works beautifully), but if you think it would be more efficient now to work at the category or class level, I'm not sure how to script the if/else statements. I'm assuming that in whichever of these solutions turns out to be best, it is applied to a single sprite which will serve to display the randomly-chosen image. Bear in mind that the script you gave me randomizes the image change every two seconds. Now I'm looking to have a choice of it changing within a range of once every half-second to once every 5 seconds (e.g. 0.5 sceonds, 1 second, 1.5 seconds, 2 seconds, etc.).
    An ancillary question: could this be done a different way? A friend suggested using subroutines but wasn't able to tell me how to do this because he doesn't know anything about Lingo. I was wondering whether the if/then syntax structure is Lingo's way of doing subroutines.
    Your thoughts would be most welcome. If you think you can't help me with this, do you have any suggestions as to where I might turn for help (apart from the nuthouse at this point)?
    Cheers,
    Dallas

  • PHP Random Images (Mr. Powers or other PHP Experts)

    Hello everyone,
    This is the script from David Power's book using arrays and the rand function (Disclosure).
    Basically it changes the images randomly on browser load or refresh.
    However, I am trying to add an additional, not sure what to call it, a string or another caption for each images.
    Instead of this being a caption, it will be a link, so a link will appear under each caption that goes to another page
    when it is clicked on for additional info about the image.
    I tried adding another caption and adding a like to it but getting syntax error.
    Thanks everyone!
    Here is the code:
    <?php
    $images = array(
    array('file' => 'image1',
    'caption' => 'Caption 1'),
    array('file' => 'image2',
    'caption' => 'Caption 2'),
    $i = rand(0, count($images)-1);
    $selectedImage = "graphics/{$images[$i]['file']}.png";
    $caption = $images[$i]['caption'];
    ?>
    And here is where the images are written to the page:
    <div id="stage">
    <img src="<?php echo $selectedImage; ?>" alt="Random image" />
    <p id="caption"><?php echo $caption; ?></p>
    </div>
    Thanks everyone!
    WE

    Thanks for the helpful link!
    I found the solution to the problem it was very simple and I feel a little stupid asking the question in the first place but, that's how learning works.
    We sometimes stumble upon knowledge.
    The problem is I was adding the second string outside of the array.
    Here is the right way:
    array('file' => 'image1',
    'caption' => 'Hello!',
    'link1' => '<a href="http://www.msnbc.com">Read more</a>',<--Instead of putting the link here
    link2' => '<a href="http://www.npr.org">Idea Center</a>'
    <-- I was putting the link here out side the array and not properly ending the string.
    $i = rand(0, count($images)-1);
    $selectedImage = "graphics/{$images[$i]['file']}.png";
    $caption = $images[$i]['caption'];
    $link1 = $images[$i]['link1'];
    $link2 = $images[$i]['link2'];
    ?>
    Output here:
    <div id="stage">
    <img src="<?php echo $selectedImage; ?>" alt="Random image" />
    <p><?php echo $caption; ?></p>
    <?php echo $link1; ?>
    <?php echo $link2; ?>
    </div>
    WE

  • Kaosweaver Random Images And CSS

    I have searched all over and can't find an answer to this and have an e-mail in to the developer but figured I would ask here as well.
    I am using Kaosweaver Advanced Random Images to rotate pics on a home page in the editable content area.  The CSS style for the text in the content area is to line up on the left.  When I insert the Kaosweaver command )even if I insert it with the cursor in the middle of the page the images line up on the left of the page.  If I make a CSS rule that centers the text there is no way to apply it to the images I can tell.....except that if I go into the code and find the name of the image in the Kaosweaver code, highlight it and right click it lets me apply the CSS rule (even though I see no visible changes to the rule.  Is this OK and will it end up causing problems on different browsers etc?
    Is there another way to do it.  I could see attaching a second style sheet just for that page with items centered as there will only be one other line of text on the page so that it won't matter if everything on that one page is centered but I don't want everything on all the pages centered.
    Is there an easier way of accomplishing this.  I was surprised in Googling this that noone else seems to have this problem....am I doing something wrong?
    Thanks.
    Howard

    Thanks Murray...it isn't on line, but I can copy the code:
    <!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"><!-- InstanceBegin template="/Templates/maintemplate.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Howard Grill Fine Art Photography</title>
    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="head" -->
    <meta name="robots" content="index, follow" />
    <meta name="Description" content="Howard Grill Photography specializes in landscape, nature, and abstract fine art prints.  Please feel free to browse, as the site, blog and galleries are updated frequently." />
    <!-- InstanceEndEditable -->
    <link href="oneColFixCtrHdr.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div class="container">
      <div class="header">
        <h1><img src="Images/headerlogo/headerlogo.png" width="515" height="41" alt="Howard Grill Fine Art Photography" /><br />
          &quot;
          Seeing Things In A Different Light&quot;<br />
        </h1>
        <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="index.html">Home</a>      </li>
          <li><a href="portfolios.html" class="MenuBarItemSubmenu">Portfolios</a>
            <ul>
              <li><a href="landscapes.html">Landscapes</a>          </li>
              <li><a href="pittsburghparks.html">Pittsburgh Parks</a></li>
              <li><a href="sceneinstone.html">Scene In Stone</a></li>
              <li><a href="dreamscapes.html">Dreamscapes</a></li>
              <li><a href="urban.html">Urban Architecture</a></li>
              <li><a href="botanicals.html">Botanicals</a></li>
              <li><a href="oddsnends.html">Odds 'N Ends</a></li>
            </ul>
          </li>
          <li><a href="#">Blog</a>      </li>
          <li><a href="articles.html">Articles</a></li>
          <li><a href="purchase.html" class="MenuBarItemSubmenu">Purchase</a>
            <ul>
              <li><a href="purchaseprints.html">Prints</a></li>
              <li><a href="purchasefolios.html">Folios</a></li>
              <li><a href="purchasenotecards.html">Note Cards</a></li>
            </ul>
          </li>
          <li><a href="about.html" class="MenuBarItemSubmenu">About</a>
            <ul>
              <li><a href="bio.html">Bio</a></li>
              <li><a href="contact.html">Contact</a></li>
              <li><a href="#">Comments</a></li>
              <li><a href="#">Mailing List</a></li>
              <li><a href="#">Website</a></li>
            </ul>
          </li>
        </ul>
      </div>
      <!-- end .header -->
      <div class="clear"></div>
      <!-- InstanceBeginEditable name="MainContent" -->
      <div class="content">
    <p> </p>
        <h2>
          <script language="JavaScript">
    // Advanced Random Images Start
    // Copyright 2001-2002 All rights reserved, by Paul Davis - www.kaosweaver.com
      var j,d="",l="",m="",p="",q="",z="",KW_ARI= new Array()
    // KW_rs[12000]
      KW_ARI[KW_ARI.length]='/Images/homepage/autumnmisthome.jpg';
      KW_ARI[KW_ARI.length]='/Images/homepage/dreamscapes1home.jpg';
      KW_ARI[KW_ARI.length]='/Images/homepage/dreamscapes3home.jpg';
      j=parseInt(Math.random()*KW_ARI.length);
      j=(isNaN(j))?0:j;
        document.write("<img name='randomSlideShow' src='"+KW_ARI[j]+"'>");
    function rndSlideShow(t,l) { // Random Slideshow by Kaosweaver
      x=document.randomSlideShow; j=l; while (l==j) {
        j=parseInt(Math.random()*KW_ARI.length); j=(isNaN(j))?0:j; }
      x.src=KW_ARI[j]; setTimeout("rndSlideShow("+t+","+j+")",t);
    rndSlideShow(12000,0)
    // Advanced Random Images End
          </script>
        <!-- KW ARI Image --></h2>
    <p>To remove the inline styles, make sure your CSS Styles panel is set to Current. Select the image, and in the Properties pane of the CSS Styles panel, right click and delete the display and background properties. (Of course, you can always go directly into the code and delete the inline styles from the image or placeholder there.)</p>
        <!-- end .content -->
      </div>
      <!-- InstanceEndEditable -->
      <div class="footer"> © 2011 Howard Grill | All Rights Reserved <span class="footertextright"><a href="index.html" title="Howard Grill Photography Home Page">Home</a> | <a href="contact.html" title="Contact Howard Grill ">Contact</a><!-- end .footer --> | <a href="sitemap.html" title="Site Map">Site Map</a></span></div>
      <!-- end .container --></div>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"../SpryAssets/SpryMenuBarDownHover.gif", imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    <!-- InstanceEnd --></html>

  • Another Unlimited Data Upgrade Question

    (Yes, it's another one of those questions.  I'm sorry, but searching - on here, or on Google - only left me with conflicting information.)
    Here's my question:
    A friend of mine is interested in selling me his Galaxy Nexus phone.  Would I be able to keep my single-line, grandfathered, unlimited data plan if I buy his phone and switch to it, or is that only possible if I were to buy the phone new, directly from Verizon?
    Here's my story:
    I have an HTC Thunderbolt that I purchased when it launched.  A few months after buying it, it turned into the HTC Bad Dream, and now it's the HTC Nightmare.  Random heat issues, battery draining, random reboots... It's the same song and dance we've heard before.  These are design issues with the phone; not something a replacement or a repair would fix.
    The real annoyance, though, is the mobile hotspot.  I pay $30/month to use the hotspot legitimately, unlike the users who root their phones to use it without paying for the option, but ever since Verizon started blocking the third-party wireless tethering apps, I've had to choose between using the stock mobile hotspot app and unleashing the above-mentioned Phonemageddon, or simply going without.  I could drop the option from my plan, but seeing as the unlimited data plan no longer exists, I wouldn't be able to get it back without switching to a tiered or shared plan.
    Switching to a more stable phone would alleviate my issues, hopefully, but the difference between Verizon's retail prices and other retailers is hundreds of dollars.  Giving up my unlimited plan, however, wouldn't make the venture worth it.  A definite answer to the question of buying used - either from a Verizon representative, or a customer who's been in the same scenario before - would be very helpful.
    Thank you very much.

    Hi,
    If you provide your own equipment (your friend's Nexus or from ebay etc) then YES you can keep unlimited data. Another wayto keep unlimited would be to pay full retail for a new phone. But I'm sure your friend will give you a better deal than that
    Hope that helps!

  • Random images display strong yellow/green cast

    system - 24" intel iMac, 3ghz, 2gb, 500bg hd, NVIDIA GeForce 8800 GS with 512MB memory, OS 10.5.4. Just purchased.
    System runs fine, and I love the machine. Problem is random images, jpegs, raw, illustrator files, display an awful yellowish tint, both in the preview and when opened in PS or preview. Just random, sometimes a whole folder of images, sometimes just a few. I, of course tested some of the same images on another mac, and they viewed correctly. If I save a copy to the desktop, the icon looks correct, but when opened it looks like puke. Also happens in front row when displaying certain album covers and video trailer art.
    Anyone else run into this?
    -h

    Hello Double H Media
    Welcome to Apple Discussions!
    Unfortunately the OP and others appear to have the same issue possibly related to the GeForce 8800 GS, see the following thread!
    http://discussions.apple.com/thread.jspa?messageID=7224138&#7224138
    Dennis

  • When opening a folder with "items as icons" view, a millisecond fast random image appears in place

    Hi,
    since I updated to Yosemite (but cannot assure it's related or started exactly that moment) I've been experienced a weird issue.
    When I open a folder to navigate it, and it's set on "show items as icons", I see all the icons, for just less than a second, replaced by random images.
    It's like if while the proper folder/file icon it's loading, that space is temporarily occupied by the impression of another one (or parts of it), coming from my computer. Sometimes is a photo, sometimes another folder icon not related, sometime is the icon of a software.
    The picture then goes away (it stays less than a second) and the icon for the file/folder is then the appropriate one.
    I have a Macbook Pro 15-inc, mid 2010.
    Is it a known issue? If yes, how can I solve, if possible, this?
    Hope can be helpful to others too.
    Many Thanks

    First off, I do not recommend looking at your time machine while it is running.  You can tell if it is running by making sure its menubar icon is shown in Apple menu -> System Preferences -> Time Machine.  If the icon is moving, it is running.   You can manually backup, which I recommend over automatic backup, as automatic backup can get in your way.   Spotlight, if it is indexing (check the menu in the upper right that looks like a magnifying glass), will also slow matters down, and adding things you don't want Spotlight to search to your Apple menu -> System Preferences -> Spotlight -> Privacy pane will help.  Note this affects areas you can search in Time Machine as well.  If searching content of files is of little interest to you, I find Find Any File much quicker for finding by file name.   Backup when you aren't doing anything else, as otherwise, you may find yourself backing up files that haven't had the opportunity to close.
      Time Machine also works best if your destination drive is at least twice as capacious as your source drive.   Otherwise it is spending a lot of time trying to find places for the archived files, and barely is more archival than a simple clone.

  • Hello from a new member and help with random images on refresh

    Hi All,
    I've just joined the forum. In fact I've really only just started to use Dreamweaver. I've covered a lot of ground in the last few weeks and
    have manage to set up a basic site using CSS for layout but now I've hit my first problem.
    On the index page of the site - http://www.hcadesign.co.uk/ there is a large main image which I would like to change each time someone
    visits the site or hits refresh. I've hunted around and found lots of scripts, all using java, that seem to do just this but I'm not having any
    luck getting them to work.
    My pages code is as follows -
    <!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>Humphrey Cook Associates - Architects - Interior Designers - Project Managers</title>
    <link href="styles/hca_styles.css" rel="stylesheet" type="text/css" media="screen" />
    </head>
    <body>
    <div id="wrapper">
      <div id="header"><img src="images/header.gif" width="800" height="100" alt="hca_header" /></div>
      <div id="menu">
        <ul>
          <li>About Us</li>
          <li>Residential </li>
          <li>Special Needs Housing</li>
          <li>Hotels</li>
          <li>Conservation</li>
          <li>Interiors</li>
          <li>Offices</li>
          <li>Sustainability</li>
          <li>Commercial</li>
          <li>News</li>
          <li>Contact</li>
        </ul>
      </div>
      <div id="main_image"><img src="images/haydock_atrium_420x300.jpg" width="420" height="300" alt="haydock_atrium" />
      </div>
      <div id="menu_right">
        <h3>Latest News</h3>
        <p>Planning permision finally granted for the proposed 'Villa De France'</p>
        <div id="news_image_01">
          <p><img src="images/news_villa_de_france_90x50.jpg" alt="villa_de_france" width="90" height="50" /></p>
        </div>
        <p>Application submitted for new 30 storey hotel with retail in Tower Hamlets</p>
        <div id="news_image_02"><img src="images/news_alie_St_90x50.jpg" width="90" height="50" alt="alie_street" /></div>
      </div>
      <div id="spacer"></div>
      <div id="bottom_left"><img src="images/riba_logo_127x67.gif" width="127" height="67" alt="riba_logo" /></div>
      <div id="bottom_thumb_01"><img src="images/thumb_beckton_95x67.jpg" width="95" height="67" alt="beckton" /></div>
      <div id="bottom_thumb_02"><img src="images/thumb_edgeworth_link_95x67.jpg" width="95" height="67" alt="edgeworth" /></div>
      <div id="bottom_thumb_03"><img src="images/thumb_tov_bathroom_95x67.jpg" width="95" height="67" alt="haydock" /></div>
      <div id="bottom_thumb_04"><img src="images/thumb_edgeworth_interiors_portrait_95x67.jpg" width="95" height="67" alt="the_old_vicarage" /></div>
    <div id="bottom_right">
      <h1>Architects</h1>
      <h1>Interior Designers</h1>
      <h1>Project Managers</h1>
    </div>
      <div id="footer"></div>
    </div>
    </body>
    </html>
    I've highlighted where the image to be rotated is in red.
    The scripts I've found have generally involved putting something in the <head>, something where the image is to be (but I wasn't sure if it should be
    within the div tag or after img src or what?) and also a seperate *.js file stored in the root directory.
    Anyway I'm not getting anywhere and need some help as I really don't know what I'm doing with javascript.
    Cheers

    Hi and Welcome to the DW Forums. 
    For the sake of clarity, Java is not the same thing as JavaScript. 2 entirely different programming languages.
    Copy and paste the following code into a new, blank HTML page.
    <!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=iso-8859-1" />
    <title>Random Banner</title>
    <script type="text/javascript">
    <!--//Random Banner image on Page Reload 
    //store the images in arrays below.
    //First banner is always image [0].
    //If you add more banners images, change the array count (4).
    images = new Array(4);
    images[0] = "<a href='http://www.example.com'>
    <img src='path/first-image.jpg' width=' ' height=' ' alt='some-description' /> </a>";
    images[1] = "<a href='http://www.example.com'>
    <img src='path/second-image.jpg' width=' ' height=' ' alt='some-description' /> </a>";
    images[2] = "<a href='http://www.example.com'>
    <img src='path/third-image.jpg' width=' ' height=' ' alt='some-description'  </a>";
    images[3] = "<a href='http://www.example.com'>
    <img src='path/fourth-image.jpg' width=' ' height=' ' alt='some-description'  </a>";
    index = Math.floor(Math.random() * images.length);
    document.write(images[index]);
    //done
    // -->
    </script>
    </head>
    <body>
    <h1>Random Banner on Page Load.</h1>
    <p>The more images you have in your array, the more random it will seem.</p>
    <p>Change the URLs from example.com to your your own site pages.</p>
    <p>Change path/image to images in your local site folder.</p>
    </body>
    </html>
    Good luck with your project,
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web-design.blogspot.com/

  • How to find the font and replace another font using javascript in illustrator?

    Dear All,
    how to find the font and replace another font using javascript [batch process] in illustrator?
    i have 700 image file, it very deficult replace one by one.
    regards,
    .Suresh.S

    Ask the creator of the file for a unprotected version.

  • Running gif animation and a random image output from an html button, HELP!!

    Trying to click (onClick) an animated gif image of an on/off switch to start a second animation which is located on a different location on the web-page (a 7-frame animation of a generator with moving parts) immediately followed by a random image selection function placing an image in a 3rd location on the page (next to the generator image). The random images are supposed to look like the result of the generator animation---the item that “pops out” of the generator.
    We thought the process to achieve this would be an “OnClick” on the on/off switch-animated-gif to start two javascript functions (generato animation function & random image function).
    To further complicate matters, we are doing this website in iWeb. We’re using iWeb SEO Tool to add the javascript to the header and HTML snippet in iWeb to place the HTML code. Not sure we’re actually doing the snippet right though---is it supposed to relate to the images---or is it separate? When the gifs are place on the iweb page, they work in the browser upon page load---the “on-click” & the random image function are NOT working...so we know we’ve done something(s) wrong.
    We’re thinking that we’re probably missing some code that describes where the 3 different image-spots are on the page (image #1 is the on/off switch gif, image#2 is the generator gif, image#3 is the generator output.png)....or just aren’t coding the string of functions correctly---or maybe our strategy for achieving this is just no correct (?).
    Here is the code we have tried that didn’t work. We desperately need a solution quickly and are open to any/other ideas for how to accomplish this. THANKS YOU in advance for your help!!!:
    script language = JAVASCRIPT>
    <!-- Hide script from old browsers
    function gif_animation(){
    if (document.images)
    generator = new Image
    generator_on = new Image
    generator.src = "christmassweatergenerator-offswitch.gif"
    generator_on.src = "christmassweater_generatoron-offswitch.gif"
    // Stop hiding script from older browsers -->
    Random Image Link Script
    By Website Abstraction (http://www.wsabstract.com)
    and Java-scripts.net (http://www.java-scripts.net)
    function random_imglink(){
    var myimages=new Array()
    //specify random images below. You can have as many as you wish
    myimages[1]="christmassweater_GENERATOR_files/cotton_candy_christmassweater.png"
    myimages[2]="christmassweater_GENERATOR_files/eiffel_tower_christmassweater.png"
    myimages[3]="christmassweater_GENERATOR_files/kitty_litter_christmassweater.png"
    myimages[4]="christmassweater_GENERATOR_files/spatula_christmassweater.png"
    <!--//specify corresponding links below
    var imagelinks=new Array()
    imagelinks[1]="#<a class="jive-link-external-small" href="http://www.christmassweaterfun.com/christmassweater_GENERATOR">http://www.christmassweaterfun.com/christmas_sweaterGENERATOR</a>"
    imagelinks[2]="#<a class="jive-link-external-small" href="http://www.christmassweaterfun.com/christmassweater_GENERATOR">http://www.christmassweaterfun.com/christmas_sweaterGENERATOR</a>"
    imagelinks[3]="#<a class="jive-link-external-small" href="http://www.christmassweaterfun.com/christmassweater_GENERATOR">http://www.christmassweaterfun.com/christmas_sweaterGENERATOR</a>"
    imagelinks[4]="#<a class="jive-link-external-small" href="http://www.christmassweaterfun.com/christmassweater_GENERATOR">http://www.christmassweaterfun.com/christmas_sweaterGENERATOR</a>"
    -->
    var ry=Math.floor(Math.random()*myimages.length)
    if (ry==0)
    ry=1
    document.write('<a href=''"'+imagelinks[ry]+'"''>')
    random_imglink()
    //-->
    </script>
    <!--the HTML:
    <a href="#" onclick="function gif_animation(); function random_imglink();">

    What's the URL of your site so we can examine it first hand? When you added the code to your post the servers messed it up and tried to render it on the page. We can get the code if we can get to your site.
    OT

  • Looking for a random image extension

    Does anybody know of a good FREE extension that will put a
    random image inside a cell of a table?
    I'm actually looking to do two different things. The first: I
    want a random image from about 10 images to change every time the
    user reloads the page. The second: I want images from about 10
    images to fade up, stay on the page for a few seconds, then fade
    down and have another one of the 10 fade up, so on and so forth.
    If anyone knows of a free extension that will do this, I
    would love to know about it, thanks!

    This one works fine for me,
    * Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (
    http://www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit
    http://www.dynamicdrive.com/
    for this script and 100s more.
    hth

  • Image Printing Question

    Hello,
    Bottom line summary: How do I use the Media and Quality setting to get a good image?
    I have an image printing question for an HP 8600 Office. I am trying to get a decent quality image to print
    on regular paper. I gather that I will not get the quality of a photo printer. I gather I'm supposed to use
    HP glossy paper. Please read on ...
    Images come out grainy (rastery) when embedded from an MSPaint project, and if I use Word. However when I printed just an image from image viewer it came like a photo ... but I can't remember what I did. It definitely is capable of printing better. My cartridges all check out, etc. I did the Print Quality Report ... I sure wish I could get that quality when I print other things.
    I tried messing with different settings from the Print - Preference. The Quality (Best, Normal, Draft) doesn't effect the outcome. I tried going into Print - Preference - Media and it makes a difference. I can't figure out which is the best setting for plain paper ... but it's not plain paper. The image rendering algorithm appears to be different for different Media settings. I also tried setting the Advanced Resolution to Maximum DPI. I haven't been totally methodical about this as I was in a rush.
    I see that the printer is being "smart", perhaps a little too smart. 
    So my question is multipart:
    - Is there documenation on the what the Print - Preference - Media settings do?
    - How do I get it to not use grainy/rastery image method, but use the nicer photo method?
    - Should I print Maximum DPI?
    Thanks,
    - Dave -

    Hi @DaveGold , and welcome to the HP Forums!
    I hope you had a great holiday!
    I see you're looking into photo setup options. I'd like to help!
    First I'd recommend this document on Changing Print Settings in Windows 7.  This document should show all the settings you're looking into.
    Also, another thing to keep in mind, when you select 'best print quality' and 'photo paper'. It will only be as good as the source image.
    Good luck and please let me know the results of your troubleshooting steps. Thank you for posting on the HP Forums!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • OLM || Issue with Image-type questions

    Hi
    This is with reference to an issue regarding the import of " Image-map " types questions in OLM.
    The legacy system which the client uses allows creation and assignment of 'Image-map" types questions to the learners.
    As far as my limited understanding goes, these types of questions are not supported in OLM.
    How to handle such types of questions in OLM , any pointers ??
    Also , what exactly are QTI standards and how to convert the existing question banks to QTI standards and then import them to OLM ??
    Thanks in advance for your time..
    Cheers

    There is one method to support these types of questions by using HTML code in the question text, but it is definitely a workaround.
    1. Use an HTML editor like Dreamweaver to create the image map or other type of interactive question. Save the html and any related images, javascript etc and upload to a content server. If the user gets the interactive question correct, provide them with some code to enter that will be used later.
    2. Select a question type like fill in the blank
    3. In the question text, use an IFRAME to embed the HTML page that contains the interactive question
    4. The correct response for this question will be based on the "code" you provide users in the interactive question if they get it correct. They would then enter this code in the fill in the blank area and get credit for answering correctly.
    Other options include building the assessment using a content authoring tool and offering the assessment as a SCORM or AICC learning object, or integrating with a third party assessment tool such as Questionmark.
    Also,
    Metalink Note ID #295865.1 contains the import/export API tech specification (this was originally written for Oracle iLearning but applies to OLM for the most part as well) and has info on the QTI spec that OLM and iLearning support.
    Scott
    http://www.seertechsolutions.com
    Message was edited by:
    scottymomo

Maybe you are looking for

  • Scope not found intermittent error

    We are using Oracle 10g R2 and BPEL 10.1.3.1. Our application consists of 2 processes. Process 1 invokes process 2 asynchronously and waits for a response. We have observed that when instances are being created for process 1 and at the same time resp

  • Installing SAP MI 7.0 in the already installed NW 7.0 system.

    Hello, We have SAP Netweaver system 7.0 with UTs EP,PI,BI. Now we want to have MI also installed for Mobile time and travel application. How can i install MI in the already installed NW 7.0(ABAP + JAVA) system. Does installing MI means - installing M

  • Eudora won't launch when trying to email photos within iphoto

    I use to be able to click on my photos and then on the email icon at the bottom and it would open Eudora with my photos attached. Now it just asks me the size and it starts to resize the photos, but never opens Eudora. I was also having problems with

  • IPhone 4S randomly lowered mms video quality?

    I have an iPhone 4S, and every video sent to me is now played at extremely low quality, and very pixelated. Why would it do that?  These videos are sent from iPhone 5's, and my phone has never done this before.

  • Stanby Database on Deffierent OS

    Hi Can i have a primary database on Windows 2003 32 bit and standby database on Windows 2003 64 bit or vice versa. Oracle version is 11.1.0.7, and will be same on both the servers. Thanks