Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Apr 2010
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Help w/ multiple javascripts

    Hey guys, this is my first post, so woohoo!

    I was wondering if anyone could take a quick look at the code for my web portfolio (i'm a graphic designer). I have a jquery lightbox, java rollovers, and lazy loader, but right now only the lightbox works. maybe someone could help me figure out why the rollovers and the lazy loader aren't working? It's a really simple site, no secondary pages. The rollovers are the social media icons under contact.

    I would appreciate it greatly!

    Thanks in advance,

    Alex

    here is the link:
    www.alexsophocles.com

    source:
    view-source:http://www.alexsophocles.com/
    Last edited by baltimorefixed; 04-22-2010 at 06:25 AM.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,627
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    This is what Firefox’ built-in JavaScript console is telling me:
    Error: illegal character
    Source: http://www.alexsophocles.com/jquery.lazyload.js
    Line: 1, Column: 1
    Code:
    {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf250
    (with an arrow pointing to the letter ‘r’ after the first backslash)
    and
    Error: $("img").lazyload is not a function
    Source: http://www.alexsophocles.com/
    Line: 14
    Looking at lazyload.js I see a few weird lines in the beginning that don’t seem to belong there. Oh, and generally I see a lot of weird backslashes. Could it be that something in the character encoding got screwed up when you saved or uploaded your file? This is the file you should use: http://www.appelsiini.net/download/jquery.lazyload.js, or, for better performance, the minified version (press Ctrl/Cmd+S to save any of these files).

    That said, the second quoted error most likely results from the first error in the lazyload script. But still, I think you’re missing the DOM ready function for that one:
    Code:
    <script type="text/javascript" charset="utf-8">
    //<![CDATA[
    $(function() {
    	$("img").lazyload({ 
        		placeholder : "images/grey.gif",
        		effect : "fadeIn"
    	});
    });
    //]]>
    </script>

  • Users who have thanked VIPStephan for this post:

    baltimorefixed (04-25-2010)

  • #3
    New to the CF scene
    Join Date
    Apr 2010
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    thanks a lot, super helpful. the back slashes were the problem, so i just used the file you provided.

    the corrected version is here, www.alexsophocles.com

    unforunately, the social media rollovers still are not working. any ideas? i really appreciate the help so far!

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,627
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    The social media buttons are layered below the portfolio section that’s why they aren’t reacting. The portfolio section has a top padding which moves the content down so you see through the div but it’s still above the links z index wise. Apply z-index: 2 to #social and it’ll work.

    On another note: I saw that you didn’t download that lazyload script but just linked to it on appelsiini.com. Please don’t do this, this is a big no-no because basically you’re stealing bandwidth from them (unless they specifically allow hotlinking). Everytime someone visits your site the script is downloaded from their site which is inceasing the bandwidth usage for them although they didn’t do anything. As I said you should save that script to your hard drive after visiting that link (Ctrl+S for Windows or Cmd+S for Mac) and upload it to your server. This also has the advantage that you’re not relying on their server to be online.

  • Users who have thanked VIPStephan for this post:

    baltimorefixed (04-25-2010)

  • #5
    New to the CF scene
    Join Date
    Apr 2010
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    thank you so much, you solved my problem! i really appreciate it.

    as for the link, i'll download it and put it on my own server asap! thanks again for all of the help.

    alex


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •