Help with fading text
Hi, I am trying to get my text to fade in and out. I am sorta new to web development. I have no idea what I am doing wrong. I am using jQuery.
Here is my code
Hi and welcome to the site.
You might also do well to learn the basics of accessibility. Fading text may look cute, but can be hard to read. Sounds to me like a case of design over content...
Ah, sorry I guess im not clear enough, this isnt just styling of the text. I want to make a single page website. And i am trying to have a fade and hide transition to different things, blog, about, etc.
Some hints for you:
Hint 1: Write proper HTML structure. The basic template for all HTML documents goes something like this:
You can get away without some of those tags -- sometimes. At other times, and especially when scripting is involved, you really need all of them. Your first task when something isn't working is to validate your HTML and check it for proper structure.
<title>Your title text</title>
Hint 2: Put the link to your script at the end of the page right above the closing body tag, like so:
Why? The script relies on the page being built before it's read by the browser. HTML is rendered left-to-right and top-to-bottom; basically the order it's written. Having the script above the <body> means that nothing is built when the script is read. It doesn't know where to find all the elements, IDs, etc.
Hint 3: Your script is looking for the first class name in your content DIVs to match the id value of the menu item clicked on. For example, you have this:
See where it says id="home" then class="home? Compare that with your next menu item and its corresponding content:
<div class="link" id="home">About</div>
<div class="home content">This is the about content.</div>
Oops, where's the class="projects?
<div class="link" id="projects">Projects</div>
<div class="blog content">This is the project content.</div>
Wow, thanks for the great explanation. All this stuff is still new but pretty exciting. Ill look into the CSS. Thank you.
Originally Posted by Kevin2
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread