We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29703
    • 217 Posts
    Nope, this is my head:

    <head>
    <base href="http://localhost/henryhoffman/"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Web Design Blog with Free CSS Tips & Tutorials</title>
    <meta name="description" content="A web design blog focusing on CSS web design techniques, template design and other free CSS tips and tutorials" />
    <link rel="shortcut icon" href="/henryhoffman/assets/templates/henryhoffman/images/favicon.gif" />
    <link href="/henryhoffman/assets/templates/henryhoffman/css/style.css" rel="stylesheet" type="text/css" />
    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="/henryhoffman/assets/templates/henryhoffman/css/iestyle.css" />
    <![endif]-->
    <link rel="alternate" type="application/rss+xml" title="Web Design Blog by Henry Hoffman" href="http://www.henryhoffman.com/feed.xml.html" />
    <script type="text/javascript" src="http://localhost/henryhoffman/assets/js/jquery-1.2.6.min.js"></script>
    </script>
    
    <script type="text/javascript">var MODX_MEDIA_PATH = "media";</script>
    
    <link rel="stylesheet" type="text/css" href="/henryhoffman/assets/snippets/jot/templates/jot.css" />
    </head>
    


    I’ve looked up the error and everyone is saying that the jQuery library has been inaccurately referenced but I know it hasn’t. I’ve also tried commenting out all other javascript bar jQuery also to no avail.
      • 7923
      • 4,213 Posts
      Yes.. it seems that jQuery is not referenced ok..

      Try changing your base url to:

      <base href="http://localhost/henryhoffman/"></base>

      And the jQuery reference to:

      <script src="assets/js/jquery-1.2.6.min.js" type="text/javascript"></script>

      And triple check that jquery-1.2.6.min.js file is in assets/js folder under henryhoffman folder.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 29703
        • 217 Posts
        Okay my head is as follows:

        <head>
        <base href="http://localhost/henryhoffman/"></base>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Portfolio</title>
        <meta name="description" content="" />
        <link rel="shortcut icon" href="/henryhoffman/assets/templates/henryhoffman/images/favicon.gif" />
        <link href="/henryhoffman/assets/templates/henryhoffman/css/style.css" rel="stylesheet" type="text/css" />
        <!--[if IE]>
        <link rel="stylesheet" type="text/css" href="/henryhoffman/assets/templates/henryhoffman/css/iestyle.css" />
        <![endif]-->
        
        <link rel="alternate" type="application/rss+xml" title="Web Design Blog by Henry Hoffman" href="http://www.henryhoffman.com/feed.xml.html" />
        <script src="assets/js/jquery-1.2.6.min.js" type="text/javascript"></script>
        	<link rel="stylesheet" type="text/css" href="blankcss" />
        
        <script type="text/javascript">
        //<![CDATA[
        function showPic(url,title,descr,width,height) {
                $("#maxImage").fadeOut("fast", function(){
                	$("#maxImage").attr({
        			src: url,
        			width: width,
        			height: height
        		});
                	$(this).fadeIn("fast");
        	});
        	$("#maxTitle").html(title);
        	$("#maxDescr").html(descr);
        }
        //]]> 
        </script>
        </head>
        


        I’m still getting the same error?
          • 7923
          • 4,213 Posts
          Do you have firebug installed? with that you can see what JS is actually loaded in to the browser from the page (by going to the js tab and viewing sources from dropdown menu). Check that is the jQuery source visible there.. Because all the errors seems to point that jQuery library is not found.

          When the page has loaded, can the pictures be changed? Does the pictures fade out/in on change?

          Can you get the site online so I could take a look?


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 7923
            • 4,213 Posts
            Haha, can’t believe that I had forgotten this already... But yeah, I had seen the same problem previously.. when you want to call the onclick with jquery, you need to use the jquery click method, not onclick..

            So replace:

            $("#maxImage1").onclick();

            with:

            $("#maxImage1").click();

            That answer was also in the topic that I posted in my first reply to you above.. You should have read it fully wink


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 29703
              • 217 Posts
              Excellent! Thanks so much for all this help - I can’t belive I missed that from the previous post.

              Any idea how to deal with the delay of the picture loading? Can I preload?
                • 7923
                • 4,213 Posts
                You can preload the images if you want. Google code for it.

                Or you can try following:

                wrap the <img id="maxImage".../> to a <div id="picHolder"></div> for example, then change the showPic function to something like this:

                function showPic(url,title,descr,width,height) {
                	$("#maxImage").fadeOut("fast").remove();
                	var image = new Image();
                	$(image).attr({src: url, width: width, height: height}).load(function() {
                		$(image).hide();
                		$("#picHolder").append(image);
                		$(image).fadeIn("fast");
                	});
                	$("#maxTitle").html(title);
                	$("#maxDescr").html(descr);
                }
                


                That should fade in the new image only after it has been fully loaded.. If you want, you can easily put some kind of a loading picture in the "picHolder" div while the new picture is loading.. google for more info.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 29703
                  • 217 Posts
                  Quote from: doze at Sep 30, 2008, 04:58 PM

                  You can preload the images if you want. Google code for it.

                  Or you can try following:

                  wrap the <img id="maxImage".../> to a <div id="picHolder"></div> for example, then change the showPic function to something like this:

                  function showPic(url,title,descr,width,height) {
                  	$("#maxImage").fadeOut("fast").remove();
                  	var image = new Image();
                  	$(image).attr({src: url, width: width, height: height}).load(function() {
                  		$(image).hide();
                  		$("#picHolder").append(image);
                  		$(image).fadeIn("fast");
                  	});
                  	$("#maxTitle").html(title);
                  	$("#maxDescr").html(descr);
                  }
                  


                  That should fade in the new image only after it has been fully loaded.. If you want, you can easily put some kind of a loading picture in the "picHolder" div while the new picture is loading.. google for more info.

                  Thanks for that. Your method would definitely be better than preloading, however I’m getting the issue that instead of the new image replacing the last one, it’s adding a new one underneath it. So whenever I start clicking on the thumbnails I get lots of bigger images appearing underneath each other.

                  Any ideas this time around?
                    • 7923
                    • 4,213 Posts
                    Try this:

                    function showPic(url,title,descr,width,height) {
                    	$("#maxImage").fadeOut("fast").remove();
                    	var image = new Image();
                    	$(image).attr({src: url, width: width, height: height, id: 'maxImage'}).load(function() {
                    		$(image).hide();
                    		$("#picHolder").append(image);
                    		$(image).fadeIn("fast");
                    	});
                    	$("#maxTitle").html(title);
                    	$("#maxDescr").html(descr);
                    }
                    


                    Added the id attribute to the new image that is created.


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 29703
                      • 217 Posts
                      Thanks! I’m now very very close. The only problem I’m having is that it isn’t fading out any more, only in. Any ideas this time?

                      Thanks - I wish I could debug this myself but I have a very limited understanding. I’m getting a JQuery book out of the library today in an attempt to gain at least a little independence.