SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: lightbox

  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    lightbox

    I am having some issues with my lightbox, can someone please help?

    it won't work for a strange reason. Here is the site:

    http://www.orangestonephotography.com/112/photos.html

    Can someone please help?

    Here is the code for the site:

    http://silver163.pastebin.com/mfd402cf

    I get no errors in Firefox debug.

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Have you added:
    Code HTML4Strict:
    rel="lightbox"
    to the links you want to trigger the effect
    Code HTML4Strict:
    <a href="#" rel="lightbox"... >

  3. #3
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Actually upon further review. I see you are using a lightbox plug in for jQuery. I have never used this version. I have always used the original. So my advice above might not have any value.

    http://www.huddletogether.com/projects/lightbox2/

  4. #4
    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)
    I'm not sure what the problem is, but I can see one very big one as it is. You are including TWO separate jQuery scripts!

    HTML Code:
    <script type="text/javascript" src="javascripts/jquery-1.2.6.pack.js"></script>
    <script type="text/JavaScript">
    <!--
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    //-->
    </script>
    <script type="text/javascript" src="js/jquery.js"></script>
    Not only that, it seems like you have two separate directories for javascript ("javascripts" and "js").

    And in between them, you have a horrible Dreamweaver script for preloading images, which seems completely unused, since you're using another preloading script before it:
    Code javascript:
    <script type="text/javascript">
    <!--
     
    function newImage(arg) {
        if (document.images) {
            rslt = new Image();
            rslt.src = arg;
            return rslt;
        }
    }
     
    function changeImages() {
        if (document.images && (preloadFlag == true)) {
            for (var i=0; i<changeImages.arguments.length; i+=2) {
                document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
            }
        }
    }
     
    var preloadFlag = false;
    function preloadImages() {
        if (document.images) {
            toolbar_03_click = newImage("images/toolbar_03-click.gif");
            toolbar_05_click = newImage("images/toolbar_05-click.gif");
            toolbar_07_click = newImage("images/toolbar_07-click.gif");
            toolbar_09_click = newImage("images/toolbar_09-click.gif");
            toolbar_14_click = newImage("images/toolbar_14-click.gif");
            preloadFlag = true;
        }
    }
     
    // -->
    </script>
    Since you're using jQuery you might as well replace both with a much cleaner jQuery version:
    Code javascript:
    jQuery.preload = function() {
      for(var i = 0, j = arguments.length; i < j; i++) {
        jQuery("<img>").attr("src", arguments[i]);
      }
    }
    Now you can preload your images:
    Code javascript:
    $.preload("images/toolbar_14-click.gif", "images/toolbar_09-click.gif");
    Once you clean all that mess up, your lightbox script might well start working. If not, then we'll take it from there.

  5. #5
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok i performed the clean up but nothing. it won't work

  6. #6
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nevermind i fixed it. it was the size of the images that were the issues.


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
  •