Results 1 to 5 of 5

Thread: Help with Image Gallery Href ... basic coding

  1. #1
    Join Date
    May 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with Image Gallery Href ... basic coding

    Any help is appreciated. I'm sure this is easy to do, but not for me

    Entire script is below the stars.

    I want the arday image (that changes daily) to be clickable and point to the page "collection.htm". So I need an <a href="collection.htm"><img src="[the arday code here ]"></a>

    Thanks.

    ***************************

    <!-- Changing Image Gallery -->

    <SCRIPT LANGUAGE="JavaScript">

    <!-- This script and many more are available free online at -->
    <!-- Rainbow Arch: http://rainbow.arch.scriptmania.com -->

    <!-- Begin
    today = new Date();
    day = today.getDay();
    arday = new Array("images/sunday.jpg", "images/monday.jpg", "images/tuesday.jpg",
    "images/wednesday.jpg", "images/thursday.jpg", "images/friday.jpg", "images/saturday.jpg");

    document.write("<img src='" + arday[day] + "'>");
    // End -->
    </SCRIPT>
    **********************

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Just add the highlighted:
    Code:
    document.write("<a href="collection.htm"><img src='" + arday[day] + "'></a>");
    This will result in your image having a border. You can style it's border to 0px if it annoys you.

    Hope that helps.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    May 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I really appreciate your reply. I gave it a go, but the image completely disappears when I type it in as you suggested.

    It's fine without the link, but it'd be great if someone could see any obvious mistake in the code.

    Thanks

  4. #4
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    My bad, try it with only one quote:
    Code:
    document.write("<a href='collection.htm'><img src='" + arday[day] + "'></a>");
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  5. #5
    Join Date
    May 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oh you are so wonderful! It works!

    I even downloaded Firebug but spent the last hour trying to work out how to use it Can't thank you enough.

    Missy

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
  •