Random image with link

Hey guys, I'm using a random image code, but when I preview the page I have a red X in the left corner of the where the image is supposed to be, but it is still clickable and it goes to the file I linked to. Here is the code

< script language = "JavaScript" >
<!-hide from older browsers


var imagenumber = 5;
var NombrAl = Math.Random ();
var rand1 = Math.round ((imagenumber-1) * NombrAl) + 1;
images = new Array
images [1] = "IMAGE #1".
images [2] = "IMAGE #2".
images [3] = "IMAGE #3".
images [4] = "IMAGE #4".
images [5] = "IMAGE #5".
var image = images [rand1]

Links = new Array
links [1] = "LINK #1".
links [2] = "LINK #2".
links [3] = "LINK #3".
links [4] = "LINK #4".
links [5] = "LINK #5".
var = links [rand1] link
-End hide here->

< /script >

Here's the code for body

< script language = "JavaScript" >
<!-hide the script from older browsers.
document. Write (' < A HREF = "' + link + '" > < IMG SRC = "' + image + '" border = "0" > < /a > ')
-End hide here->
< /script >

I know your picutres are there, why not try this, after the =, right-click, select Code Hint tools | URL browser and use the tool to link the images.

You listed as Pictures\Accounting Cartoon1.jpg, the slash is false, then let DW set the path and the file for you.

Gary

Tags: Dreamweaver

Similar Questions

  • slide show code generating random images with clickable links

    I make a slide show with images that occur randomly wch hav clickable links, OK it works but sometimes, the transition is very fast instead of the 8 s interval I expected, when I discovered the exit trace(), I noticed that sometimes the timer is triggered two times or more at the same time... my code is below... What perhaps may cause well u want to help

    I have 21 pictures with 21 images

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    Import fl.transitions.TweenEvent;

    import flash.events.MouseEvent;

    Stop();   slide stops

    var total_images:Number = 21;

    var my_playback_counter:Number = 0;

    showslide();     call to the showslide function

    defination function with the timer event

    function showslide (): void {}

    var myTimer:Timer = new Timer (8000);

    myTimer.addEventListener (TimerEvent.TIMER, timerListener);

    myTimer.start ();

    }

    / * function timelistener

    After 8 s, meter reading in increments of 1.

    Then reset to 0 playbckcounter if it is equal to total images

    */

    function timerListener (e:TimerEvent): void {}

    my_playback_counter = my_playback_counter + 1;

    If (my_playback_counter == total_images) {}

    my_playback_counter = 0;

    }

    trace ("Timer is triggered"); trace when the timer goes off

    NextImage();

    }

    function NextImage (): void {}

    var pic_number:Number = 21;

    var randomframe:Number = Math.ceil (Math.random () * pic_number) ;// randomly generates betwwen number 1 and 5

    trace (randomframe);

    gotoAndStop (randomframe); display a random image

    }

    Button1.addEventListener (MouseEvent.CLICK, onMouseClickB1);

    function onMouseClickB1(e:MouseEvent):void {}

    var request: URLRequest = new URLRequest ("http://www.aginternetwork.org/en/");

    navigateToURL (request, "_blank");

    }

    new Tween(btn1,"alpha",None.easeOut,0,1,1,true);

    Each time the playhead returns to frame where this code is another instance of Timer will be created.  Try to put a conditional on the showslide function call so that he will not repeat...

    var showStarted:Boolean; by assigning not it is null or false

    {if(!showStarted)}

    showslide()

    showStarted = true; but once they assign remains true

    }

  • Right-click on the image with link problem after upgrade to 11.0

    After the upgrade, whenever I do a right-click on an image with a link, it opens the link rather than opening a menu drop-down. Any idea on what is causing this behavior?

    OK, think about it. Extension: Tab Utilities was the origin of the problem. Uninstall completely solved the problem, disable it does not solve it.

  • Image with link in Firefox features, half of the image/link is active in Chrome, image/link in Safari

    I have a page with links to nav 2 from 2 different images. 1 image / link works well with Firefox, Chrome and Safari. The other image / link works well with firefox, only half of the image is active in Chrome and none of the image is active in safari. Fine links documents extraction. I replaced the image, the container as well as relinked. The result is the same. Can someone please? Here is a link to my site (current) PikiPiks: critical film the first 2 images in the left column are currently linked. The first image / link for "From Kiki's Delivery Service" is the problem.  Thank you! MacOS 10.9 / Dreamweaver CS6

    Delete the empty apDiv7 after your tag.

    In this case, apDiv7 has a higher z-index and covers some of the other items on the page, so clicks will this empty layer instead of the links below.

    Some browsers allow you to better guess what you will do when they run into errors like this, looks like Chrome is less forgiving in this situation.

    Also, look at using css floats, margins, and padding to position elements, rather than position: absolute, you are likely to encounter more problems if you continue to use the APDiv button.

  • Images with links display a blue border around them in Explorer

    Here is the link:

    http://www.canyons.edu/faculty/golbertm/index.html

    Twitter image with a link to his account is what I am referring.  Very similar to FireFox.  Explore 8 not so much.  I have the same problem on another site, I built.  Resolution would be very appreciated.

    Thank you.

    Elizabeth

    Add the following line anywhere in the GolbertSyle.css:

    an img {border: none ;}}

  • associate images with links

    Thanks to all and sorry for the confusion because I am a beginner at the post office, too.

    Updated the post *.

    I have download 0001.gif:
    Shared Componets/files/Images/create/upload

    I changed the code as Sonny_starck said:

    & lt; img src = "" #WORKSPACE_IMAGES #lbc.bmp "alt ="My Logo"/ & gt;"


    {color: #ff0000} to create a google link, I modified as following: {color}


    " & lt; a href =" http://www.Google.com/ "target ="_blank"& gt; "

    & lt; P align = center & gt; & lt; img src = "" #WORKSPACE_IMAGES #0001.gif "alt ="banner"/ & gt;" & lt; /P & gt;


    & lt; /a & gt;
    But I would like to have multiple images to associate with links to other pages within the same application.
    {color: #000080} Image 1: Page2 in the same application
    Image2: page 3
    Image3: page 4
    Image4: page 5 of the other application {color}

    ************************** OLD POST****************

    {color: #333333} I'm working on the links with images.

    I inserted after code /Shared Componets/templates/page

    [
    | http://www.Google.com/]

    [
    | http://www.Google.com/]

    I tested with the banner, and it works.

    But I would like to have multiple images associated with links.

    Image links
    Imag1 www.google.com
    Image2 page 2 in the same application
    Image3 www.yahoo.com
    Page 3 of the application of different Image4

    Published by: WinSilver on January 27, 2009 10:17

    Published by: WinSilver on January 27, 2009 10:19

    Published by: WinSilver on January 27, 2009 10:19

    Published by: WinSilver on January 27, 2009 10:20

    Published by: WinSilver on January 27, 2009 10:22

    Published by: WinSilver on January 27, 2009 12:07

    Published by: WinSilver on January 27, 2009 12:08 {color}

    Published by: WinSilver on January 27, 2009 12:09

    Hello

    Ah, ok - all I did was create a new request and, when prompted, said no authentication. It is an application on my workspace OTN - do you have a?

    Andy

  • How to create a rotating image with links

    Hello, I am a novice when it comes to Web design. I created this site for my business...

    www.gomvpsport.com

    I was told to create an image of rotation on the home page that performs a cycle 5 images that each have a unique integrated link. I know how to create a rotating image in Flash and publish it in SWF, but it does not work on an iPhone, etc.

    I would avoid using Flash, unless there is a new way to export and also if there are unique links for each image (5).

    I use Dreamweaver CS6 on a PC.

    In the attached photo, I want that the area within the pink to rotate every five seconds in a loop. And I want that every picture is linked to another url. I have need of before arrows and back or buttons.

    banner example.jpg

    www.gomvpsport.com

    Yes, Flash is dead.

    Look at the jQuery plugins.  jQuery works in all devices that support JavaScript.

    Nancy O.

  • Image with linked source

    OK, so now I have:

    < mx:Image source = "{boxes... box0.pkmn1.img}" width = "32" height = "32" / >

    When I run the program, boxes begins as an empty XML, which is then filled by a HTTPService object. However, I get this error before anything displays:

    Error: Failed to load ".
    at mx.controls::SWFLoader/loadContent() [C:\autobuild\3.2.0\frameworks\projects\framework\src \mx\controls\SWFLoader.as:1617]
    at mx.controls::SWFLoader/load() [C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\con trols\SWFLoader.as:1380]
    at mx.controls::SWFLoader/commitProperties() [C:\autobuild\3.2.0\frameworks\projects\framewor k\src\mx\controls\SWFLoader.as:1167]
    at mx.core::UIComponent/validateProperties() [C:\autobuild\3.2.0\frameworks\projects\framewor k\src\mx\core\UIComponent.as:5807]
    at mx.managers::LayoutManager/validateProperties() [C:\autobuild\3.2.0\frameworks\projects\fr amework\src\mx\managers\LayoutManager.as:539]
    at mx.managers::LayoutManager/doPhasedInstantiation() [C:\autobuild\3.2.0\frameworks\projects \framework\src\mx\managers\LayoutManager.as:659]
    service / http://adobe.com/AS3/2006/builtin: applies ()
    at mx.core::UIComponent/callLaterDispatcher2() [C:\autobuild\3.2.0\frameworks\projects\framew ork\src\mx\core\UIComponent.as:8628]
    at mx.core::UIComponent/callLaterDispatcher() [C:\autobuild\3.2.0\frameworks\projects\framewo rk\src\mx\core\UIComponent.as:8568]

    I have no idea what this means: S...

    Your viewable images using a Repeater, TileList or another component that uses dataProvider?

    If so, have the dataProvider initially gave empty dummy and then fill it with data when the data has been loaded.

    If this post answers your question or assistance, please mark it as such.

  • Random images with setInterval

    Hello

    Here is the code I use to display randomly my images, but very 20 seconds I want that he show a new image at random. I'm sure that I need to use the setInterval, but don't know how to include it in my current code. Any help would be greatly appreciated.

    filename = ['img01.swf', 'img02.swf', 'img03.swf', 'img04.swf', 'img05.swf'];
    path = "" http://www.mywebsite/flash/swf/ "; "
    I have = filename.length;
    k = Math.floor (Math.random () * i);
    loadMovie (path + file name [k], my_mc);

    Thank you
    KG

    You are welcome.

    the following will prevent the same image appear twice in a row:

  • Remove the border around the image with link

    I know this is really basic, but I can't find anywhere how to avoid having a purple color around a linked image border. Help please!

    Nope. Not if you want valid XHTML.

    CSS does the trick-

    an img {border: none ;}}

    * and * you don't have to add to each individual tag.

    --
    Murray - ICQ 71997575
    Adobe Community Expert
    (If you * MUST * write me, don't don't LAUGH when you do!)
    ==================
    http://www.projectseven.com/go - DW FAQs, tutorials & resources
    http://www.dwfaq.com - DW FAQs, tutorials & resources
    ==================

    "Dan.Smith" wrote in message
    News:gn22if$I6K$1@forums. Macromedia.com...
    > border = "0".
    >
    >a
    >
    > --
    > Dan Smith > adobe community expert
    > Flash help > http://www.smithmediafusion.com/blog/?cat=11
    > twitter: http://twitter.com/dmode
    >

  • Random Image Script need with links

    I need a script for random images on my home page. I need the image to have its own link depending on which image is displayed. I would like a script php (no database) if possible

    I thought about it by doing a random include

    <>
    srand (Time ());
    $random = (rand () %3);
    require_once("./$random.php");
    ?>

  • Hotspots or links on background image with checkerboard to fluid.

    I have a fluid grid presentation in CS6 with a home page with a background image (javascript that loads different images.  What is the best way to bind or 'hot spots' more than one large image for three menu items in random places on this page?

    Is your native Photoshop PSD image with layers?  You must save the background (building & logo) as a single image layer.  Then each of the 3 menu items save it as transparent PNGs without the background layer.

    Put the background.jpg in your head with CSS.

    Insert the Menu.pngs in your HTML and link them as needed.

    Just to let you know, the web pages that contain nothing but images do not exist for the search engines, readers screen or the language translators.  You really need to insert text rich true keyword inside

    ,

    ,

    and

    Tags.   Without content keyword rich, nobody will ever find your site in searches on the web.

    Also consider that many mobile users disable the images to record the minutes of data.  If your site is nothing more than images, they won't see much.

    Nancy O.

  • can anyone provide a link to insert the image with the text on the button in the apex 4.2.6

    can anyone provide a link to insert the image with the text on the button in the apex 4.2.6

    ReemaPuri wrote:

    in the workspace image:-resign.jpeg

    As a button? Seriously?

    Ok. First of all, because the image already contains text, there no point in including the same wording in the form of text on the button. Accessibility requirements can be met using re-sign as alternative text. 4.2, create an image button:

    Tag/Alt text: Re-sign

    Static ID: re - sign

    Style button: Image

    Button Image: & WORKSPACE_IMAGES.resign.jpeg

    To make the image looks more like a button, add the following CSS to Inline CSS property page:

    #re-sign img {
      margin: 0 2px 2px 0;
      border: 2px outset;
      border-radius: 4px;
    }
    #re-sign img:active {
      margin: 2px 0 0 2px;
      border: 2px inset;
      border-radius: 4px;
    }
    

    Finally, there is a bug in 4.2 that generates the incorrect URL for the button images, which requires dynamic action of Page Load to fix.

    Event: Loading the page

    Action: Run the JavaScript Code

    Code

    var resignImg = $("#re-sign img");
    resignImg.attr("src", resignImg.attr("src").replace("/i/", ""));
    
  • How to activate a part of an image with a link when creating emails?

    How to activate a part of an image with a link when creating emails?

    Hello. You can do this with an image map, but there are some questions that you need to consider before using a. Check out this blog for some thoughts on the subject:

    http://www.campaignmonitor.com/blog/post/3475/image-maps-in-HTML-email/

  • Help! How am I suppose to add a "map link" an image with this new dreamweaver

    Help! How am I suppose to add a "map link" an image with this new dreamweaver?

    First, click on the small arrow next to the direct button on the toolbar and choose Design menu drop-down

    Once you are in design mode, click a picture in your page

    The Image Map tools will appear in the Properties window (press F8 or window > properties if it is not open)

Maybe you are looking for