Announcement Announcement Module
Collapse
No announcement yet.
trying to install and get jQuery to work... Page Title Module
Move Remove Collapse
Search Search Module
Collapse

Advertisement Advertisement Module
Collapse

Latest Topics Latest Topics Module
Collapse

  • PrintDriver
    Reply to Norman Vintage Wedding Invite
    PrintDriver
    If you want email notification, you have to turn it on in your user preferences.
    Yesterday, 11:25 PM
  • PrintDriver
    Reply to Can't send attachments from Illustrator...
    PrintDriver
    When you saved your illustrator file, you need to save it with PDF enabled in order to drag and drop it.
    That said, you shouldn't be doing it this way.
    If it is just a proof for your client...
    Yesterday, 11:24 PM
  • B
    Reply to Newspaper Graphic Designer
    B
    Ad design and editorial design are usually handled out of separate departments at larger newspapers. Editorial design is often divided between "pagination" (laying out the news pages) and feature...
    Yesterday, 10:52 PM
  • EightyTwenty
    Reply to Need tips with designing a logo
    EightyTwenty
    Hey guys!

    So I have been pondering how I could make this work, I tried to follow a few youtube videos on branding and how to display the proper ways of your core identity.

    I...
    Yesterday, 09:25 PM
  • bubby17346
    Reply to Can't send attachments from Illustrator...
    bubby17346
    Can you save the files out of AI as a .pdf and send that to the client. That's how I send all of my files to clients and coworkers alike. I keep the .ai files on my computer but always save as a .pdf...
    Yesterday, 09:15 PM

X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • trying to install and get jQuery to work...

    I want to play around with some jQuery, but I can't get anything to work. I must be missing something somewhere...I posted my test page below. When I click the link it should fade the red box out, but nothing happens. I don't get any errors in Firebug and I know my path to the javascript file is correct. Any ideas?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <meta name="subject" content="" />
    <meta name="Description" content="" />
    <meta name="Keywords" content="" />
    <title></title>
    <link href="xxx.css" rel="stylesheet" type="text/css" media="screen"/>
    <link rel="icon" href="favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <script src="http://www.site.com/js/jquery-1.3.2.min.js" type="text/javascript"></script>

    <style type="text/css">

    #box {background-color: red; width: 300px; height: 300px;}

    </style>

    <script type="text/javascript">
    $(function() {
    $('a').click(function() {
    $('#box').fadeOut();
    });
    });

    </script>


    </head>

    <body>

    <div id="box">

    </div>
    <a href="">fade Out</a>

    </body>

    </html>

  • #2
    haha wow, find out the problem....I added a "#" into the link href and it worked...

    <div id="box">

    </div>
    <a href="#">fade Out</a>

    Comment


    • #3
      Two quick things:
      1)You should link to jQuery like this:
      Code:
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
      That way it's possible the user will have it cached.

      2) you should add return false to the end of any link function that doesn't activate a link
      Code:
      $('a').click(function() {
      $('#box').fadeOut();
      return false;
      });
      This makes sure that the link is not activated by the browser.
      Swedish Meatball Pornography

      Comment

      Mediabistro A division of Prometheus Global Media home | site map | advertising/sponsorships | careers | contact us | help courses | browse jobs | freelancers | content | member benefits | reprints & permissions terms of use | privacy policy Copyright © 2015 Mediabistro Inc.
      Working...
      X