Close Label not showing in Lightbox2

Discussion in 'Web Design and Development' started by Dal123, Oct 10, 2010.

  1. Dal123 macrumors 6502a

    Dal123

    Joined:
    Oct 23, 2008
    Location:
    England
    #1
    I've had this problem for quite a while and so far have tried:
    Changing the location of the 'closelabel.gif', by putting it in the same folder as the lightbox.js file, as I originally thought it may have been a problem with directories (folders going through folders).
    Then I thought it may be the file itself, tried it as a .png and different files etc. but NO.
    With the firefox add-on I have notice (pictured) that in the bottom right corner (red outlined box) you can see that it is not lining-up properly. So there must be some sort of formatting issue with the anchor tag. I'm not sure where it's happening. Anyone familiar with lightbox come across this sort of thing before.
    I also tried re-installing lightbox, which I thought would sort any issues out, but it still is not working. So maybe something is happening through my php as the album is generated by
    PHP:
    <?php
     
    // settings
    $base "data/rc_beam";
    $thumbs "thumbs";
     
    $files scandir($base);
    unset(
    $files[0], $files[1]);
    unset(
    $files[array_search('.DS_sStore'$files)]);
    $i 0;
    foreach (
    $files as $file)
    {
        
    // For every tenth iteration, do something special
        
    if ($i++ % 10 == 0)
        {
            
    // Do whatever you need
        
    }
        echo 
    "<a href='$base/$file' rel='lightbox[group]'>        <img class='thumbs' src='$base/$thumbs/$file'>";
    }  
    ?>
    So I'm thinking that something is happening there. Pretty complex and fiddly to my individual site so just appealing to anyone that has come across something like this themselves :).
     

    Attached Files:

  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    You my have the wrong path for the closelabel.gif. The path is set for ../closelabel.gif, but this is already at the root level, so you're telling it to go above the root, which is not going to work. If the file is inside the same folder as the lightbox, then use lightbox/js/closelabel.gif and make sure the image is actually in there.
     
  3. Dal123 thread starter macrumors 6502a

    Dal123

    Joined:
    Oct 23, 2008
    Location:
    England
    #3
    Thanks angelwatt, I spent ages on that.
    I thought that when you was referencing from that particular file 'lightbox.js' then the files were in position relative to that. example, pictured required is in the same folder as 'lightbox.js' then you would only have to put it as 'closelabel.gif'. But this didn't work, It's been a while since I've tinkered with web design so I'm bit rusty (I was never shiny to begin with :p), but I could've sworn I'd done stuff like this before.
    So are documents always positioned relative to the root folder - if you know what I mean :eek:?
    Thanks again for your help bud :D.
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    What you're thinking of is for CSS files. Images references in CSS files are made relative to where the CSS file is (or just absolute paths). I generally try to always use absolute paths as then you don't need to worry about where the files are put.
     

Share This Page