SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2010
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    display a random image

    i have the simple code below to display a random image; how can i modify this line to place the random image at 225px wide by 141px high?

    Code JavaScript:
    document.getElementById("highlight_1").src = randomimage1;

    thanks!
    Last edited by paul_wilkins; Jun 14, 2011 at 16:30. Reason: replaced the code-review summary

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If you want the image to be those dimensions, you need to set height and width via the style object.


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
  •