Web Analytics Made Easy -
StatCounter Image gallery project - formating title - CodingForum

Announcement

Collapse
No announcement yet.

Image gallery project - formating title

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Image gallery project - formating title

    Hello again, I am still working on this project, www.timelessurns/handmade3.html

    Things are going well so far, I can click on a thumbnail and the gallery and the desdription both change as they are supposed to!!! My problem to overcome now is that the description is dependent on the title of the thumbnail and I would like it to look nice. I can set the Style in the DIV to change the color, size and font but it all comes out in one line. so when I want it to read:

    URN # W 112

    White glaze with peach top

    9.5” tall, 6.5” wide
    280 cubic inch
    Price: $ 295.00

    but it will only output:
    URN # W 112 White glaze with peach top 9.5? tall, 6.5? wide 280 cubic inch Price: $ 295.00


    Then on top of that I would like it to have an active link for each image either in the description or in the gallery image.

    Here is my javascript(thank you Jeremy Keith):

    Code:
    function showPic(whichpic) {
      var source = whichpic.getAttribute("href");
       var placeholder = document.getElementById("placeholder");
       placeholder.setAttribute("src",source); 
       var text = whichpic.getAttribute("title");
       var description = document.getElementById("description"); description.firstChild.nodeValue = text;
      }
    It seems like I could do something with getElementByTagName to create an onclick event in the gallery image. but I just haven't learned enough to write it out or even to know if it is possible.

    If someone could point me in the right direction for these two issues I would be grateful.

    Thanks,

    Jason

  • #2
    I have figured out a solution to the first problem of formating the title/description, but I would still be grateful for any suggestions on how to make a changing link.

    J.

    Comment

    Working...
    X