photo

Yellx Hosting

shared this question
3 weeks ago

Statistics

0
Comments
1
Views

Share

Tags

1
votes

main_image_java - Tag, changes to add lightbox

I am trying to add a lightbox to the website. I am getting close and do have it working.

try it out:-

www.yellx.co.uk

But I am having some trouble changing the code I have removed from the main_image_java - Tag, See Below:-

  1. <script type="text/javascript"> function imgchange(id,caption,description){if(document.images)

    {document.getElementById('main').src = id; document.getElementById('main').alt = caption; document.getElementById('main_image_description').innerHTML = description; }

    else { document.getElementById('main').src = "images/nophoto.gif";document.getElementById('main_image_description').innerHTML = ''; }}

    </script>

    <img src="{raw_image_full_1}" width="600" id="main" alt="Main image Caption"><br><div id="main_image_description">Main Image Description</div>

I need to fill in the "width" , "alt" , "main_image_description" got "scr"

was trying to add some code like this :-

  1. var first_id = document.getElementById('main').src;

    var first_caption = document.getElementById('main').alt;

    var first_description = document.getElementById('main_image_description').innerHTML;

    <img src="{raw_image_full_1}" width="600" id="' + first_id + '" alt="' + first_first_caption + '"><br><div id="main_image_description">' + first_description + '</div>

my knowledge of JavaScript is very basic. any help work be great

Leave Comment

photo

Attach files...

The file must be a jpg, gif, png, bmp, ico, pdf, doc, rtf, txt, zip or rar no more than 20M